hi all,
i wrote a simple c++ program in xcode 3, which has one class in which i defined all the member functions in the class declaration, then still in the same file, i wrote the main function which used the class. When i compiled it, it worked fine, but now my prof is asking me to separate it into different files.
so basically i did this:
header file: class definition (with just function prototypes, no body) ( included #ifndef; #define; and #endif)
cpp file: #include "header.h" --here i defined the functions that i declared in the header file, i defined them using this template:
<return type> <ClassName>::<function name> (<parameters>)
cpp file: #include "header.h" --this was the main file that used the class above
this does not compile, and i can't figure out why
i wrote a simple c++ program in xcode 3, which has one class in which i defined all the member functions in the class declaration, then still in the same file, i wrote the main function which used the class. When i compiled it, it worked fine, but now my prof is asking me to separate it into different files.
so basically i did this:
header file: class definition (with just function prototypes, no body) ( included #ifndef; #define; and #endif)
cpp file: #include "header.h" --here i defined the functions that i declared in the header file, i defined them using this template:
<return type> <ClassName>::<function name> (<parameters>)
cpp file: #include "header.h" --this was the main file that used the class above
this does not compile, and i can't figure out why