can someone give me an example of a header file and its cpp file with multiple functions and classes on the header?
Can we initialize header functions on different cpp files? What if two or more .cpp files has initialize the same functions? Or does the compiler looks for the function initiailizor(or whatever u call it) on its <ClassNameonHeader>.cpp?
You compile the sources into object files (you can see what symbols are defined with `nm')
Later you link them into the executable (resolve the function calls)
If two cpp define the same function, and you try to link them together then it will give you the
`multiple definition of ...' error
thats what i just thought...just wanna confirm it
thanks @ne555
anyway, i have another question
is there a datatype that can accept all datatypes for "cout" purposes
for example
1 2 3 4
void popUp(string msg)
{
cout << msg << endl;
}
im hoping i can find a datatype to replace in <string> so whatever i send to pop() it will cout it
like pop(DWORDtype) / pop(intType) etc....
EDIT:: nvm i got it now, i just overload the function and place (int msg) as the parameter of the second function, dont know if it will work on every type thought
oh cool, i have no idea what was template awhile ago
but now that i googled it, its pretty awesome. i will implement it right away
thanks again @ne555, i would hug u but cant