#define NL "\n" //"NL" = "New Line"(move the pointer to the next line)
#define SL "\n\n" //"SL" = "Skip Line"(move the pointer 2 lines)
Cool_Class Cool_Object; //WHY CAN'T THIS WORK!!!
std::cout << "SPRING!!!" << NL;
OK, so if I create the object in "main.cpp" it works, but there must be another way, right. All objects ever created cannot have all been created in the file containing "main()" can it?
The error I get is something like "Cool_Object was not declared in this scope".
So what is the problem here? Is it just Code::Blocks(I use Code::Blocks) that sucks or what? lol...
1 Year Ago
Related Article:Not declared in this scope, Help!
is a C++ discussion thread by rayden150 that has 2 replies, was last updated 7 months ago and has been tagged with the keywords: c++, declarations, file, show.
Your declaration of member functions is wrong in the test.cpp Should be like void Cool_Class::cool_function() Also, it has been a while since I do OOP in C++ but I think you also need to declare a constructor, so the object knows how to exist...