void main()
{
	int ch;
	Stud *head=NULL;
	clrscr();
	while(ch!=0)
	{
		 printf("\n\n\t\t1. Add End\
				   \n\t\t2. Add Mid\
				   \n\t\t3. Display\
				   \n\t\t4. Delete Beg\ \
				   \n\t\t5. Rev\
				   \n\t\t6. Sort\
				   \n\t\t0. Exit\
				   \n\t Enter Your choice ");
		 scanf("%d",&ch);
		 switch(ch)
		 {
			case 1:
				  head=AddEnd(head);
				  break;
			case 3:

				  Display(head);
				  break;
			case 2:
				 {
				   int pos;
				   printf("\n\n\t Enter The Pos ");
				   scanf("%d",&pos);
				   head=AddMid(head,pos);
				  }
				  break;
			case 4:
			head=DelBeg(head);
			break;
			case 5:
				 head=Rev(head);
				 break;
			case 6:
				 head=Sort(head);
				 break;
		 }
	}
	getch();
}
Beispiel #2
0
void CFrontendDlg::HandleOlsrMid(struct OlsrHeader *Msg)
{
	int Size;
	unsigned int *Addr;

	Msg->SeqNo = ::ntohs(Msg->SeqNo);

	AddNode(Msg->Orig, Msg->VTime);

	Size = Msg->Size;

	Size -= sizeof (struct OlsrHeader);

	Addr = (unsigned int *)(Msg + 1);

	while (Size > 0)
	{
		Size -= 4;

		AddMid(*Addr, Msg->Orig, Msg->VTime);

		Addr++;
	}
}