newbai napsal:
Quote:
I have a query.Hope someone can help me in this!!!
A c++ code consists of include statements,main(),function defination
.now I want to make separte files.I mean the first file will be of only
include statements.The secand of funciton defination and third of
main().but I dont know how to make them?how do you name them??
can someone explain me with a simple example?
please be fast!!!thanks
You can name your files as you want. Usualy exist some project or
company naming conventions. For C sources are usually used files with
..c extension. For C++ sources is typically used one of .cpp, .cc, .C
extension. For header files is used .h extension, sometimes is used for
C++ headers .hpp or .hh or .H.
There is no standard requirement how to name file with main (as for
example in java). one of the typical way is to place main function in
file main.cpp. Sometimes is the main function placed in file with the
same name as project.
It is important to use correct upper/lower case letters in #include
files, beacuse in some operating systems are used such filesystems,
where file header.h is different from Header.h.
Syntax of Makefile depends on which make are you using. It is compiler
(or better make) specific. Gnu make is not 100% compatible with
Microsoft nmake and it is not compatible with borland make (and of
course vice versa).