Q:

Define a pair of classes X and Y, in which X has a pointer to Y, and Y has an object of type X

0

Define a pair of classes X and Y, in which X has a pointer to Y, and Y has an object of type X.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

struct Y;

struct X {
  Y *y;
};

struct Y {
  X x;
};

int main() {
  return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now