   How do i make a header file? ( .h and .c )
  How do i make a header file in C (or C++)?Is that what i have to do is to put the functions in a .c file, and the others in the .h file?like this:   // if i written a program like this:void abc(void){  //some code here...}int main(){  //some code here...}then i should have a head.h file written as:   void abc(void);and a head.c file written as this:   void abc(void){  //some code here...}then when i use them in a main program, i could just link the .h file like this?   #include "head.h"#include <stdio.h>int main(){  //some code here...}right?But then i got this lovely error message..."fatal error C1010: unexpected end of file while looking for precompiled header directive"What did i do wrong? Thanks very much for helping 
"fatal error C1010: unexpected end of file while looking for precompiled header directive"I think it''s a bug in MSVC, add a newline at the end to fix it. GCC handles this correctly and prints: "No newline at end of file, please boycott Microsoft.". ;  It''s MSVC, and it''s not ANSI compliant, but you''re not quite right.The first line of your CPP file *MUST* be to include the precompiled header file (stdafx.h by default).;  I think this may be caused by having precompiled header enabled in your project. The compiler is looking for the header to be included. By default its usually called stdafx.h. Try searching through the help documents for disabling precompiled header. looks like Namethatnobodyelsetook beat me to it.   [edited by - Wolfdog on February 3, 2004 12:27:20 PM];  Yes you need to either disable precompiled headers for the *whole* project in all configurations or put a #include <stdafx.h> at the very start of your body (.c/.cpp) files.To disable precompiled headers you need to:1) Select "Project" menu ->Settings.  (project settings dialog appears2) ensure that the *project* is selected in the lefthandside and that you change "settings for" option to "All Configurations"3) Select the C/C++ tab4) Change "category" to "Precompiled headers"5) Select "Not using Precompiled headers"6) OKIt's important that step 2 is correct otherwise you'll just turn them off for a specific file or just the debug version etc  [edited by - stubble on February 3, 2004 12:45:15 PM];  Alternatively, you can switch to c# and you don''t have to worry about headers, because there are none!Also, C# compiles natively on XP and Longhorn and for Longhorn it''s faster than win32 executables (not to mention compatability with XAML).A free client is avaliable at www.icsharpcode.net called #develop.www.codeproject.com has free C# tutorials.If you''re a newbie, why not get a jump on current developers? ;quote:Original post by Anonymous Poster  If you''re a newbie, why not get a jump on current developers?Safety in numbers? Far less tutorial material, etc than C++? Far less communal knowledge (particularly in hobby and video game communities)?Pick one. ;  Thanks guys, the error message are now gone... But a new one come up... If i have a "struct" defined, do i need to include it in both .h and .c file? or just it the .h file?Thanks again  To: Anonymous Poster,  Yes, i'm a newbie. And at one point, i did thought about C#, but then i thought that would make me too MS dependent... [edited by - NewbieA on February 4, 2004 2:36:43 AM];  It''s just necessary to have it in the .H file, since it is included by the .C file already. ;  Thanks Unwise owl But then now the compiler reply me this while linking "error LNK2001: unresolved external symbol "void __cdecl ....."  What did i do wrong this time?   [edited by - NewbieA on February 4, 2004 3:03:08 AM]