struct dlinklist
{
struct dlinklist *prev; /** Stores address of previous node **/
int data;
struct dlinklist *next; /** stores address of next node **/
};
typedef struct dlinklist node;
void init(node*,int);
void main()
{
node* head;
clrscr();
head=(node*)malloc(sizeof(node));
head->next=NULL;
head->prev=NULL;
init(head,5);
}
void init(node* current,int p)
{
current->prev=NULL;
current->data = p;
current->next=NULL;
}
{
struct dlinklist *prev; /** Stores address of previous node **/
int data;
struct dlinklist *next; /** stores address of next node **/
};
typedef struct dlinklist node;
void init(node*,int);
void main()
{
node* head;
clrscr();
head=(node*)malloc(sizeof(node));
head->next=NULL;
head->prev=NULL;
init(head,5);
}
void init(node* current,int p)
{
current->prev=NULL;
current->data = p;
current->next=NULL;
}
No comments:
Post a Comment