Can anybody tell me when to use typedef in C? In the following code I get a warning by gcc :
warning: useless storage class specifier in empty declaration
typedef struct node
{
int data;
struct node* forwardLink;
} ;
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.
So..
You can do this:
To define an object that you can use as
struct node.Like this:
However, say you wanted to refer to it as just
node. Then you could do:or
and then use that as: