error: expected specifier-qualifier-list at the end of input

This is a discussion on error: expected specifier-qualifier-list at the end of input within the C Programming forums, part of the General Programming Boards category; Code: typedef struct { int flag ; //1 if 0 atrib union { char *cond; struct { char *var; char ...

  1. #1
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187

    error: expected specifier-qualifier-list at the end of input

    Code:
    typedef struct 
    { int flag ; //1 if 0 atrib
      union { 
    	char *cond;
            struct  {
                    char *var;
                    char *exp;
                   } atrib;
            } conteudo;
    Any idea why this is happening ?

  2. #2
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187
    Noticed it's missing a } in the end but still doesn't work.

    Gives me this error now :

    error: expected identifier or ‘(’ at end of input

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,419
    What are you trying to do?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    C Beginner
    Join Date
    Dec 2011
    Location
    Portugal
    Posts
    187
    Just defining that structure.

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,419
    Quote Originally Posted by DeanWinchester
    Just defining that structure.
    What structure?

    Let me put it this way: you have in mind a structure. You want to express it in code, but you have a problem in doing so. Therefore, you should express it in code to tell us what you have in mind, then we can help you express it in code. Instead, when asked to explain, you just state the obvious that you have in mind a structure. Therefore, the most logical answer to your question is to be equally vague:

    Quote Originally Posted by DeanWinchester
    Any idea why this is happening ?
    Yes, you made a mistake in your code.

    Doesn't help very much, does it?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #6
    Registered User
    Join Date
    May 2010
    Posts
    2,694
    Why are you trying to embed the union, and another structure inside your structure? Proper indentation might actually be able to help you see where your problem lies.

    Jim

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 02-15-2011, 12:51 AM
  2. expected specifier-qualifier-list ip.h
    By quantt in forum C Programming
    Replies: 1
    Last Post: 02-12-2009, 09:24 AM
  3. specifier-qualifier-list
    By Raman in forum C Programming
    Replies: 2
    Last Post: 11-04-2008, 07:12 AM
  4. error: expected specifier-qualifier-list before
    By chinook86 in forum C Programming
    Replies: 6
    Last Post: 03-01-2008, 01:02 AM
  5. Replies: 1
    Last Post: 01-24-2008, 12:07 PM

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