#ifndef CLASSA_H#define CLASSA_H#include "classB.h"class ClassA : public ClassB{public: ClassA() {} int val;};#endif // CLASSA_H
#ifndef CLASSB_H#define CLASSB_H#include "classA.h" // [1]//class ClassA; // [2]class ClassB{public: ClassB() {} ClassA *ptr;};#endif // CLASSB_H
#include "classA.h"int main( int, char *[] ){ ClassA t; return 0;}
C++ (Qt)class Vector;class Matrix { // ... friend Vector operator*(Matrix&, Vector&);};class Vector { // ... friend Vector operator*(Matrix&, Vector&);};
#include <stdio.h>int main(int argc,char **argv){ printf("%d",userfunc(3));}int userfunc(int x){ return x+pow2(x);}int pow2(int x){ return x*x;}