header files and source files c and c++ difference

hi

I have to use "c" when working on the gameboy advance and I'm trying to learn some diffrences going beyond the lack of classes and abstract datatypes.

So with header files will "c" have multiple definitions of data declared in headers in each single ".c" file? And also how can enumerations be declared extern style in header files, then get defined in header files.

1
2
3
4
5
6
...
//why does c hate this
//this is the header file

extern enum E_GAMESTATE;
...


1
2
3
4
5
6
7
8
9
10
11
//the .c file
//The issue is that when i include the header file above, other header files 
//think my enum is undefined 
...
 enum E_GAMESTATE
{
START_SCREEN,
MENU,
HIGHSCORES
};
...



Plus in "c" will char * cspecial_array be able to extract any string length entered?
Last edited on
Topic archived. No new replies allowed.