How can I declare a pointer structure using {}?
- by Y_Y
This probably is one of the easiest question ever in C programming language...
I have the following code:
typedef struct node
{
int data;
struct node * after;
struct node * before;
}node;
struct node head = {10,&head,&head};
Is there a way I can make head to be *head [make it a pointer] and still have the availability to use '{ }' [{10,&head,&head}] to declare an instance of head and still leave it out in the global scope?
For example:
//not legal!!!
struct node *head = {10,&head,&head};