H
Holden
Hello,
I am using Visual C++ 6.0 with Service Pack 5 installed and I have run
into a problem that I haven't been able to figure out. I have written
two classes and I want them to have pointers to each other. So class
One has a private class variable of type Two and class Two has a
private class variable of type One. I #include the header file of the
other class in each file. When I try to build the project it gives me
three errors, all in regards to the line that the variable is declared
(ex: 'One' : missing storage-class or type specifiers). If I change
the order that the classes are included in Main.cpp from:
#include "One.h"
#include "Two.h"
to:
#include "Two.h"
#include "One.h"
then I get errors on the opposite classes (ex: 'Two' : missing
storage-class or type specifiers).
Is this something that I can't do in C++? Is there a problem with
Visual C++? Do I need to change my code or a setting somewhere?
Thanks in advance,
Holden.
I am using Visual C++ 6.0 with Service Pack 5 installed and I have run
into a problem that I haven't been able to figure out. I have written
two classes and I want them to have pointers to each other. So class
One has a private class variable of type Two and class Two has a
private class variable of type One. I #include the header file of the
other class in each file. When I try to build the project it gives me
three errors, all in regards to the line that the variable is declared
(ex: 'One' : missing storage-class or type specifiers). If I change
the order that the classes are included in Main.cpp from:
#include "One.h"
#include "Two.h"
to:
#include "Two.h"
#include "One.h"
then I get errors on the opposite classes (ex: 'Two' : missing
storage-class or type specifiers).
Is this something that I can't do in C++? Is there a problem with
Visual C++? Do I need to change my code or a setting somewhere?
Thanks in advance,
Holden.