please help me with my problem...
i have here a running program...but then you have to press the keyboard twice in order to input data..
can you help me to modify my source code???please..my future depends on you...-_-
specification:
Accepting data in the lists should only terminate only if the escape key is pressed
Assumption:
new->is a string variable that accepts data
*next->is a defined pointer of the list
*temp,*first,*last->are pointer variables
procedure:
while(1)
{
z=getch();
if(z==27)
break;
else
{
gets(new);
if (first==NULL)
{
first= (ENTRY *)malloc(sizeof(ENTRY));
strcpy(first->string,new);
first->next=NULL;
last=first;
}
else
{
temp=(ENTRY *)malloc(sizeof(ENTRY));
strcpy(temp->string,new);
temp->next=NULL;
last->next=temp;
last=temp;
}
}
}