Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include "func.h"
- void addToList(thelist* shoppingList);
- //-------------------------------MAIIN------------------------------------------------
- int main()
- {
- int option; //Variable for choosing in the menu
- thelist shoppingList; //initiation of the struct shoppingList
- initThelist(&shoppingList);
- while(1)
- {
- printf("Welcome to your the list handler.\n 1 - add a food item\n 2 - print the shoppinglist\n 3 - Remove an item\n 4 - Change the amount \n What would you like to do?\n");
- if(shoppingList.listLength==0)
- {
- printf("List is empty\n");
- }
- else
- {
- printf("List is not empty\n");
- }
- scanf("%d", &option);
- switch(option){
- {
- case 1:
- {
- addToList( &shoppingList);
- break;
- }
- case 2:
- {
- printList( &shoppingList);
- break;
- }
- case 3:
- {
- delItem( &shoppingList);
- break;
- }
- }
- }
- return 0;
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement