error: storage class specified for parameter

This is a discussion on error: storage class specified for parameter within the C Programming forums, part of the General Programming Boards category; you have problems in genlist.h and missing HEADER_GUARDS in list.h...

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

    and missing HEADER_GUARDS in list.h
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  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!

Page 2 of 2 FirstFirst 12
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, 08: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

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