hello everyone,im trying to make a simple program run but i cant seem to make it work,i have been working on this for the whole day :\ any hand
Code:
#include<stdio.h>
struct Node{
int Data;
struct Node *Link;
};
typedef struct Node *QueuePointer;
void append(QueuePointer *Head,QueuePointer *Tail, int Num)
{
QueuePointer NewNode;
NewNode=(QueuePointer)malloc(sizeof(struct Node));
NewNode->Data=Num;
NewNode->Link=NULL;
if (Tail==NULL)
*Head=NewNode;
else
(*Tail)->Link=NewNode;
*Tail=NewNode;
}
void main()
{
QueuePointer Tail;
int value,a,b,c;
int x;
Tail=NULL;
clrscr();
for(b=1; b<6; b++)
{
printf("Enter Values to Append: ");
scanf("%d",&Tail);
}
{
for(a=1; a<6; a++)
append(&Tail);
while(Tail!=NULL)
{
printf("%d\n",&Tail);
}
}
getch();
}