my error is storage class specified for parameter

This is a discussion on my error is storage class specified for parameter within the C Programming forums, part of the General Programming Boards category; i need a bit of help. i have the following code Code: #ifndef PERSON_H_INCLUDED #define PERSON_H_INCLUDED #include <stdio.h> #include <stdlib.h> ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    3

    my error is storage class specified for parameter

    i need a bit of help. i have the following code


    Code:
    #ifndef PERSON_H_INCLUDED
    #define PERSON_H_INCLUDED
    #include <stdio.h>
    #include <stdlib.h>
    
    typedef struct nod
    {
      char name[50];
      unsigned int birthdate;
      char address[100];
      char cnp[14];
        struct nod *next;
        struct nod *prev;
    } PersonEntryT;
    
    
    typedef struct
    {
            int size;
        PersonEntryT *last;
        PersonEntryT *first;
        }ListDT;
    
    
    extern ListDT *createDList();
    extern PersonEntryT *createDNode( char name[], unsigned int birthdate, char address[], char cnp[]  );
    extern PersonEntryT *insertDDepOnKey(char a[], PersonEntryT  *p, ListDT *L);
    extern PersonEntryT *findDyear(  int key,  ListDT *L);
    extern PersonEntryT *findDcnp(char key[],  ListDT *L);
    extern char *printDItem(PersonEntryT  *pItem);
    extern PersonEntryT *insertDAtEnd(PersonEntryT *p, ListDT *L);
    extern void deleteDItem (void *pItem);
    extern int keyCmp(int a, int b);
    
    
    #endif // PERSON_H_INCLUDED

    after compiling i get the following error serie:



    Code:
    error: storage class specified for parameter 'insertDDepOnKey' 
    error: storage class specified for parameter 'findDyear' 
    error: storage class specified for parameter 'findDcnp' 
    error: storage class specified for parameter 'printDitem' 
    error: storage class specified for parameter 'insertDAtEnd' 
    error: storage class specified for parameter 'deleteDItem' 
    error: storage class specified for parameter 'keyCmp'
    what is the problem?
    i saw that there was another person who had the same problem, i checked all the possible remedees that u suggested him, but i didn't find any missing semicolon or parathesis. Also this is my only header file in the program, the parameters are checked, their type and order is correct. Thought i bet the problem is with them .
    Thank u for any help, suggestion.(PS i would need an urgent respons)

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,968
    Sorry, but I cannot duplicate those errors with your sample code.
    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

  3. #3
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,158
    My only explanation is that the closing paren on the end of this line must not actually be there:

    Code:
    extern PersonEntryT *createDNode( char name[], unsigned int birthdate, char address[], char cnp[]  );
    The following errors are probably due to the "extern" keyword. If that paren was missing, the following prototypes would be interpretted as parameters, and extern is illegal in that context.

    Are you sure you've posted the exact code you are using? Because those semicolons should also have thrown out some errors if they were found inside a parameter list.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  4. #4
    Registered User
    Join Date
    Mar 2009
    Posts
    3
    hey u were right!!!thank u sooo much!! the extern command was the problem.
    thank u!!!!

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,968
    Quote Originally Posted by meli
    the extern command was the problem.
    Huh? The extern is redundant here, but the point is that a missing closing parenthesis could be the problem.
    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
    Mar 2009
    Posts
    3
    i checked several times, seems like no missing paranthesis to me, but i may be mistaking. It works now though, so thanks for your time brewbuck and laserlight

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. help on class coupling
    By andrea72 in forum C++ Programming
    Replies: 4
    Last Post: 04-17-2011, 10:16 AM
  2. Replies: 3
    Last Post: 07-08-2008, 10:01 AM
  3. Replies: 5
    Last Post: 07-17-2006, 03:13 PM
  4. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 06:18 AM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM

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