I am making a menu to perform multiple actions on a linked list, however once I ask the user to enter MAXSIZE for the linked list the program then brings up the "MENU" asking the user what they would like to do, and then the program exits right after a continue statement is useless here because I am not inside of a loop.
int main()
{
/* Start with the empty list */
struct Node* head = NULL;
int MAXSIZE;
printf("Welcome to the Menu\n");
printf("To begin please select a MAXSIZE for the linked list\n");
scanf("%d",&MAXSIZE);
printf("A. Priority queue\n");
printf("B. Append list\n");
printf("C. Eliminate from list\n");
printf("D. Reverse the linked list\n");
printf("Please enter your choice: ");
char var;
scanf("%c",&var);
int j=1;
if(j==1){
switch(var){
case 'C' :
case 'c':
printf("Created Linked List: ");
int h;
printList(head);
printf("\nPlease enter number to eliminate");
scanf("%d",&h);
eliminateFromList(head, h);
printf("\nLinked List after Deletion of %d:\n",h);
printList(head);
printf("\n");
break;
case 'B':
case 'b':;
int temp2;
int temp1;
for(int i =0; i<MAXSIZE; i++){
printf("Please Enter a value to populate array along with a priority between 1 and 10");
scanf("%d",&temp1);
scanf("%d",&temp2);
push(&head,temp1,temp2);
}
break;
case 'A':
case 'a':
printf("Hello world\n");
break;
case 'D':
case 'd':
printf("Hello world\n");
break;
}
}
}