Quote:
Originally posted by gogettergary
1. the header files in my project include each other..will this create any problem?
|
This will be a problem, unless you follow the often used way to prevent problems with this. To do this for an example header file called "foo.h":
Code:
/* At the start of "foo.h" do this: */
#ifndef FOO_H /* uniquely identifies this header file */
#define FOO_H
/* Put actual contents of your header here */
/* And at the end: */
#endif /* FOO_H */
It's generally a good idea to do this for each header you create. But use a different, unique macro for each one. E.g. for a header "bar.h" you would do the same thing, but use "BAR_H" instead of "FOO_H".
Quote:
2. do i need to specify the system header files (iostream math.h infotype etc.) separately like i specify created header files?
as in : pooja.o : headerf1.h hf2.h
|
No.
Quote:
3. wats the difference in using gcc n g++ .my prgs are .cpp but im using gcc -o p p.cpp
will it giv problems??
|
gcc is the
C compiler.
g++ is the
C++ compiler.
Sometimes (often?) you can compile
C-code with a C++-compiler (g++). But not the other way around: you cannot compile
C++-code with a C-compiler (gcc).