GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Aug-2004, 02:15
nkhambal nkhambal is offline
Regular Member
 
Join Date: Jul 2004
Location: CA USA
Posts: 313
nkhambal is a jewel in the roughnkhambal is a jewel in the rough

Structure compilation problem


Hi,

I have following structure format
CPP / C++ / C Code:
#define CI_DEPTH 5
typedef int (*FP)(char **);

extern typedef struct 
{
	char *c1;
	char *c2;
	char *c3;
	char *c4;
	char *c5;
	char *c6;
	char *c7;
	char *c8;
	char *c9;
	char *c10;
	FP function_pointer;
}ci_struct;
 
ci_struct cli[CI_DEPTH]=
{"add","user","EOL","EOL","EOL","EOL","EOL","EOL","EOL",ci_add,
 "delete","user","EOL","EOL","EOL","EOL","EOL","EOL","EOL","EOL",ci_delete,
 "show","user","EOL","EOL","EOL","EOL","EOL","EOL","EOL","EOL",ci_show,
 "exit","EOL","EOL","EOL","EOL","EOL","EOL","EOL","EOL","EOL",ci_exit,
 0,0,0,0,0,0,0,0,0,0};

when i try to compile the same.I get following error mesages for structure initialization.

ci.h:25: multiple storage classes in declaration of `ci_struct'

Whats is possibly wrong with this structure?

Any comments?

Thanks,
Nilesh.
  #2  
Old 03-Aug-2004, 08:16
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 4,709
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold
extern typedef doesn't work. Just use typedef

Then you will see other problems:

1. cli[0] has nine (char *) before the function pointer (needs 10)
2. functions cli_add, cli_delete, etc should be declared:

CPP / C++ / C Code:

int ci_add(char **);
int ci_delete(char **);
int ci_show(char **);
int ci_exit(char **);


Dave
 
 

Recent GIDBlogMeeting the populace by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[CONTEST?]Data Structure Test dsmith C Programming Language 2 06-Jun-2004 15:13
C I/O problem kelly80 C Programming Language 4 27-Apr-2004 20:15
Another FX 5600 problem (but with details that might shed light on this) BobDaDuck Computer Hardware Forum 2 16-Apr-2004 07:53
problem with php5 cgi installation fab13 Apache Web Server Forum 3 19-Nov-2003 09:11

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 15:48.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.