I have a code :
struct Node
{
struct Node (int data)
{
this->data = data;
}
int data;
};
int main ()
{
return 0;
}
I read that we can initialize the structure inside the stucture. But my compiler gives an error when I do that. The error occurs on the definition of structure twice
is better. the error you are getting is because "struct" in struct Node (int data) remove the word struct. Post the entire code using the "<>" (code) tag from the format menu