Thread: error: storage class specified for parameter

  1. #16
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,794
    you have problems in genlist.h

    and missing HEADER_GUARDS in list.h
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

  2. #17
    Registered User
    Join Date
    Mar 2008
    Posts
    27
    Quote Originally Posted by vart View Post
    you have problems in genlist.h

    and missing HEADER_GUARDS in list.h
    genlist.h
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include "common.h"
    
    
    #define MAXLIST 300
    
    typedef int Position;
    
    typedef char ListEntry;
    
    typedef struct listnode{
            ListEntry info;
            struct listnode *next;
    }ListNode;
    
    typedef struct list{
            int count;
            ListNode *head;
    }List;
    
    void CreateList(List *);
    ListNode *MakeListNode(ListEntry);
    Boolean ListEmpty(List *);
    Boolean ListFull(List *);
    int ListSize(List *);
    void InsertList(Position, ListEntry, List *);
    void SetPosition(Position, List*, ListNode **);
    void DeleteList(Position, ListEntry *, List *);
    void TraverseList(List *, void(*)(ListEntry);
    void Print(ListEntry);
    What's HEADER_GUARDS?

  3. #18
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    You are missing a close parenthesis in the TraverseList function.

  4. #19
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,794
    Quote Originally Posted by aim4sky View Post
    What's HEADER_GUARDS?
    Code:
    #ifndef COMMON_H
    #define COMMON_H
    
    ....
    
    #endif
    In general - you should put this indef in each header file - changing the define accordingly
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

  5. #20
    Registered User
    Join Date
    Mar 2008
    Posts
    27
    Thank you tabstop and vart for helping!

  6. #21
    Registered User
    Join Date
    Mar 2009
    Posts
    1
    I had the exact same problem, and my mistake was missing semicolon in the line before the struct definition!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with FIFO QUEUE
    By jackfraust in forum C++ Programming
    Replies: 23
    Last Post: 04-03-2009, 08:17 AM
  2. Class design problem
    By h3ro in forum C++ Programming
    Replies: 10
    Last Post: 12-19-2008, 09:10 AM
  3. Defining derivated class problem
    By mikahell in forum C++ Programming
    Replies: 9
    Last Post: 08-22-2007, 02:46 PM
  4. matrix class
    By shuo in forum C++ Programming
    Replies: 2
    Last Post: 07-13-2007, 01:03 AM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 01:30 PM