包含你所定义结构的文件就可以了
e.g
#include "thestruct.h"

解决方案 »

  1.   

    可以
    class class1{
      int x;
    public:
      struct struct1{
           int x;
           int y;
      };
    };class class2{
      int x;
    public:
      struct struct1{
           int x;
           int y;
           int z;
      };
    };Then you could use class1::struct1 and class2::struct1 at the same time.
    And you could use namespace too.
      

  2.   

    当然可以,最好的做法是你用namespace
      

  3.   

    使用namespace,在class1中使用一个namespace1,
    class2中使用namespace2.