Thread: my error is storage class specified for parameter

  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
    28,413
    Sorry, but I cannot duplicate those errors with your sample code.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    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
    28,413
    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.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    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, 07:18 AM