im trying to get a memeber function to perform a cout statement but everyt time i compile it tells me that in this member function that "cout" was never declared in this scope I've tried numerous approaches but none have worked can some one help me please.
I assume that you have #include <iostream> somewhere already. All standard library classes are implemented in the std namespace. You can either put usingnamespace std; after your #include directives, or write std::cout. The latter is better practice, because it avoids mixing in all the std namespace declarations with your own.
should have mentioned this but this function is in a file called cdie.cpp, the main function is in main.cpp, and the head file is where the class is located in cdie.h. everytime i intiate g++ -c main.cpp cdie.cpp it gives me that error message all the files include the header file and the directives are in the main.cpp as well as namespace std.