Hello, I was wondering if it was possible to prototype classes in C++. Rather than have everything above the main function, I`d like to organize it better and put certain classes below the main function as well.
I know about the possibility of prototyping functions, which does help out quite a bit! Just hoping any of you know of any possibility of doing the same for classes.
I`ll post my code for my project, which is literally just me learning classes in C++. Just incase anybody here needed it.
I know about the possibility of prototyping functions, which does help out quite a bit! Just hoping any of you know of any possibility of doing the same for classes.
I`ll post my code for my project, which is literally just me learning classes in C++. Just incase anybody here needed it.
#include <iostream> using namespace std; //The class I wish to appear below the "int main" function. class TestClass{ public: void sayings() { cout << "Your computer is dead to me." << endl; } }; //Just the main function, which prints out the sayings function within the TestClass class. int main() { TestClass testObject; testObject.sayings(); return 0; }