+ 1
Another question about classes and headers. Is this possible?
Hi all. I have been writing a practice "board game" in c++ which is only in text format as I still haven't cracked graphics (grrr). But really it is just so I can get an understanding of language structure and variable manipulation. Now the text bit is almost completed, I have loads of code in my main.cpp. I have each individual part of the game as a function which is called. Is it possible to move each of theae functions into a new cpp file with copy and paste?
4 ответов
+ 3
hi:)
you should copy your function to .cpp file and declare them in .hpp file .
in file.hpp:
void f(int a);
+ 2
thats better somehow you use namespaces for a bunch of functions.
like std.
+ 2
Thank you. Didn't want to just move it all round and wreck it.
+ 1
If I do, does that make them classes? Will I need to create headers with constructors and destructors?
Thank you?