I finally overcame this problem by defining the struct and class in a namespace in the header file and to get access to the struct and methods in the namespace from the cpp, I used the scope operator. I know that for some experts, this may be obvious but for us newbies, it can sometimes be mind boggling to get our heads around these things. Anyway here is the code.
Sorry but I forgot to comment that ie.e. #include "Cards.h"ou t when I was posting the code. I still get errors when I compile even with the line commented out. Help!!
I''m a new C++ programmer and I am having a few problems with some structs that I have defined in my header file and want to use in my CPP file. The struct called "deck" is defined in a file called "Cards.h". In the corresponding CPP file called "Cards.cpp" when I try to use the struct "deck", I get a lot of errors from the compiler as displayed in my compiler errors below. I have tried...
Leave a comment: