Morning! I am facing a small problem with the following code: Code: #include <iostream> #define DIM 1 #include "cTest.h" int main() { return 0; } and here the cTest.h-file: Code: #pragma once #ifndef CTEST_H #define CTEST_H class cTest { public: cTest(void); ~cTest(void); void Count () { cout << DIM; } }; #endif Now I am getting the following errors: Could you please let me know, what I am doing wrong? Thanks! F.R.
Dear shabbir, thanks for the reply. But: 1.) #include <iostream> is the new standard. adding .h is not used any more. 2.) using namespace std was not working, still the same erros are coming up But thanks. F.R.
What compiler you are using which gives error on adding "using namespace std". If it gives error for "using namespace std" that does mean you need to include the file using the older method of .h
Hi. I am using VC++8.0, so there shouldn't be any problem with including 'using namespace std;'. What i meant is, that even including this line, the errors mentioned in my first post don't disappear. F.R.
Okay. this one works. But how do I get 'DIM' into the cTest class without writing the definition a second time?