Mar 18, 2009 at 8:45pm UTC
I made a program and save it . In the folder I can get the .cpp file but not .h file .Can anyone please tell me where can I get the .h file of my program ?
Mar 18, 2009 at 8:58pm UTC
thank you jsmith for you lecture . I learnt alot from that.
Can you please tell me how to write it or give an example .
Mar 18, 2009 at 9:03pm UTC
1 2 3 4 5 6 7 8
//includes, directives, etc.
#ifndef _YourHeader
#define _YourHeader
//declarations
#endif
Last edited on Mar 18, 2009 at 9:04pm UTC
Mar 18, 2009 at 9:08pm UTC
1 2 3 4 5 6 7 8 9
#ifndef _.h
#define _.h
void MilesperGal();
void mileage();
void fuelUsed ();
#endif
]
Is this what you mean ?
Last edited on Mar 18, 2009 at 9:42pm UTC
Mar 18, 2009 at 10:27pm UTC
Is is ok to save the program with extension .h ?
Mar 19, 2009 at 1:55am UTC
Save the main program as a .cpp and save the header as .h.
If it is just a small program then I wouldn't worry about conditional compilation.