C++ class cross reference problem# Programming - 葵花宝典
h*t
1 楼
Could any C++ guru help me? Thanks a million in advance.
I need to write two classes each of which refers the other class. However, I
could not compile it. Below is a sample code to show what I really need. It
has two files, test.h and test.cc. The implementation is not given; however,
it could be compiled with "g++ -c test.cc",
/******* beginning of the source code of test.h *********/
#include
class index_object_1;
class index_object_2;
class index_object_1_comparator;
class index_object
I need to write two classes each of which refers the other class. However, I
could not compile it. Below is a sample code to show what I really need. It
has two files, test.h and test.cc. The implementation is not given; however,
it could be compiled with "g++ -c test.cc",
/******* beginning of the source code of test.h *********/
#include
class index_object_1;
class index_object_2;
class index_object_1_comparator;
class index_object