compiler error in sample program for my class

This is a discussion on compiler error in sample program for my class within the C Programming forums, part of the General Programming Boards category; ok so i was given the following as a sample program in my C class but I can't compile it ...

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    1

    compiler error in sample program for my class

    ok so i was given the following as a sample program in my C class but I can't compile it without getting an error that says line 22: Parse Error, expecting ''}'' 'int'

    http://www.cs.ucf.edu/courses/cop350...nstructarray.c

    So either my professor made a mistake, which I assume is unlikely or there's something wrong with the way I'm trying to compile it. I've tried using jGRASP and Miracle C and both give me similar errors.
    I haven't really programmed in C for a few years so i'd really appreciate the help
    Thanks.

  2. #2
    Registered User slingerland3g's Avatar
    Join Date
    Jan 2008
    Location
    Seattle
    Posts
    603
    Code looked ok. well I got no error using gcc 3.4.4 within cygwin, ignore the PAUSE error though.

    output:

    Code:
    $ ./error.exe 
    How many digits do you want in your number?
    10
    sh: PAUSE: command not found
    2650928864

  3. #3
    Registered User slingerland3g's Avatar
    Join Date
    Jan 2008
    Location
    Seattle
    Posts
    603
    I can guess a cut and paste error perhaps?

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You're going to have to compile this as C99, due to mixed declarations.


    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need the code of few programs in c++.plzzzzz help...plzzz
    By NAVINKR20 in forum C++ Programming
    Replies: 1
    Last Post: 05-08-2009, 09:13 AM
  2. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  3. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 11:39 AM
  4. Difficulty superclassing EDIT window class
    By cDir in forum Windows Programming
    Replies: 7
    Last Post: 02-21-2002, 04:06 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21