Why is this throwing an error?

Правка en1, от PUSSY_LICKING_LOLI_69, 2024-09-08 09:25:10

I've been messing with struct and pointers in C++ and got this problem.

This code gives an error saying " ‘x’ does not name a type " at the line marked below

struct A{
    A *a;
};

struct B{
    A *x;
    x = NULL; // this line gives error
};

What causes this and how do I fix this problem?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский PUSSY_LICKING_LOLI_69 2024-09-08 09:25:10 353 Initial revision (published)