Thread: what does these errors mean

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    19

    what does these errors mean

    While trying to convert my program from C++ to C, i'm getting lots of errors.

    Can anyone tell me what these errors mean:

    syntax error before & token

    [Warning no] semicolon at end of struct or union

    syntax error before '=' token

    [Warning] data definition has no type or storage class


    Should i post my codes for you to see better??

  2. #2
    Awesomefaceradcore bivhitscar's Avatar
    Join Date
    Apr 2006
    Location
    Melbourne, Australia
    Posts
    210
    Quote Originally Posted by tsubasa
    Should i post my codes for you to see better??

    It would be a nice start, but the errors are kinda self explanatory.
    it's ironic considerate rarity patron of love higher knowledge engulfs me...

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    19
    I've deleted it.

    Sorry for the waste of board space.

    I thank you both for the tips you gave me.
    Last edited by tsubasa; 05-23-2006 at 03:14 AM.

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    That was an incredible waste of board space. You don't need five thousand lines of code just for a few errors.
    1 - Errors give line numbers, even if they're just "close to this" guesses.
    2 - Look at your code, find the line number, read it (or post it in this case).
    3 - This is the C board. Your code is C++.
    Code:
    printf("              C++ Calculator\n");
    C doesn't have a 'string' data type. It doesn't have references. Etc.

    [edit]
    I see you mentioned you're converting from one to the other. Well for starters, get rid of all the things that are C++ only, such as what I mentioned above. Also, some of these really are simple. For example, when it says you don't have a semicolon at the end of a structure, that's pretty much what it means.
    [/edit]

    Quzah.
    Last edited by quzah; 05-23-2006 at 02:41 AM.
    Hope is the first step on the road to disappointment.

  5. #5
    Awesomefaceradcore bivhitscar's Avatar
    Join Date
    Apr 2006
    Location
    Melbourne, Australia
    Posts
    210
    Holy crap. Umm, this is wrong:

    Code:
    extern double calc(char* , int&);
    That is too much code to read through, try and find out where the errors are occuring and read some of the C FAQs here on this site.


    [EDIT]

    Quote Originally Posted by quzah
    3 - This is the C board. Your code is C++.
    Well, he did say he was converting from C++ to C.



    [EDIT v2]


    Damn you!
    Last edited by bivhitscar; 05-23-2006 at 02:43 AM.
    it's ironic considerate rarity patron of love higher knowledge engulfs me...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. global namespace errors
    By stubaan in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 03:11 PM
  2. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 10:50 AM
  3. Stupid compiler errors
    By ChrisEacrett in forum C++ Programming
    Replies: 9
    Last Post: 11-30-2003, 05:44 PM
  4. Help me with these errors... :-(
    By major_small in forum C++ Programming
    Replies: 6
    Last Post: 09-07-2003, 08:18 PM
  5. errors in class(urgent)
    By ayesha in forum C++ Programming
    Replies: 2
    Last Post: 11-10-2001, 06:51 PM