Beispiel #1
0
main()
{
char ch;
abc:
	printf("Enter operation:\n1>add record_press A or a..\n2>print_press P or p\n3>Exit_press e or E\n4>Save_press s or S\n5>Delete_all_press d or D\n");
	scanf(" %c",&ch);
switch(ch)
{
case 'a':
case 'A':
	add_begin(&headptr);
	//break;
	goto abc;
//add_begin(&headptr);
case 'p':
case 'P':
	print(headptr);
	goto abc;
	//break;
case 'e':
case 'E':
	break;
case 's':
case 'S':
	save(headptr);
	goto abc;
	//break;
case 'd':
case 'D':delete_all(&headptr);
	goto abc;
	//print(headptr);	
//	break;
}
goto abc;
}
main()
{
	int i =1;
	struct st *headptr=0;

	while(i)
	{

		printf("want to enter new data ...? \n plz enter   1=continue  & 0=exit  \n --> ");
		scanf("%d",&i);
		if(i==1)
		{
			add_begin(&headptr);
		}
		else
		{
			i=0;

		}


	}

	print(headptr);
}
Beispiel #3
0
main()
{
char ch;
B *headptr=0;
do
{
add_begin(&headptr);
printf("Do you want to add new node\n");
scanf(" %c",&ch);
}while((ch=='Y')||(ch=='y'));

print(headptr);
}
Beispiel #4
0
int main()
{
	Node *head=NULL;
	int iRetCode=eFailed;
	
	iRetCode = add_begin(&head,11);
	LOG_CHECK_ERROR(iRetCode);
	
	iRetCode = add_begin(&head,22);
	LOG_CHECK_ERROR(iRetCode);
	
	iRetCode = add_begin(&head,33);
	LOG_CHECK_ERROR(iRetCode);

	iRetCode = add_end(&head,44);
	LOG_CHECK_ERROR(iRetCode);
	
	print(head);
	Reverse_list(&head);
	print(head);
Exit0:	
	return 0;	
}
Beispiel #5
0
int main()
{
ST *headptr=0;
char ch;
do
{
add_begin(&headptr);
	printf("you want to add data... Y/N \n");
	scanf(" %c",&ch);
}while( ch=='y' || ch=='Y' );
print(headptr);

return 0;
}
Beispiel #6
0
main()
{
	B *headptr=0;
	char ch;
	read(&headptr);
	print(headptr);
	printf("\n---------------\n");
	do
	{
		add_begin(&headptr);
		printf("Do you want to add Y/y\n");
		scanf(" %c",&ch);
	}while(ch=='Y' || ch=='y');
	print(headptr);
	save(headptr);
	rev_data(&headptr);

	printf("\n----------------\n");
	print(headptr);
}