i m new to C++ programming and using turbo c++ as an IDE.
I m confused about some topics.
. I m trying to define a class and its attributes in a header file and defining its functions
in a .cpp extension file
.do we have to compile our own header files?
. I have also saved both the files in the same directory.
. in compiling a header file i m getting error ( syntax error in class declaration).
.my .cpp file gives no error in compilation but does not runs. i m getting
messages such as "linking noname.exe"
please help me out with this as i m not able to apply concepts in datastructures
Post for us specifically what you are doing (including pertinent code), and in particular you errors and the lines to which they refer.
Header files are included by source files (at least, that's the idea). You can then compile source files (which themselves contain the header files they include) into object files. For a given program, these object files will refer to each other. Then the linker resolves these references and creates an executable that does whatever you told it to, starting in main() in one of your source files.
Header files let your code know what's out there and how to use it, while source files define what is out there.