Do I need to use typedef in order to build recursive structs? I tried to use the following code without success:
struct teste
{
int data;
int data2;
struct teste to_teste;
};
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To build recursive structs you do not need
typedef.You will have to convert the struct object into a
struct pointerobject.like this: