Skip to content

Instantly share code, notes, and snippets.

@Technicus
Created March 10, 2014 04:57
Show Gist options
  • Save Technicus/9459700 to your computer and use it in GitHub Desktop.
Save Technicus/9459700 to your computer and use it in GitHub Desktop.
/*****************
* Embedded Programming
* Practice: Empty menu
* Files: menu.c
* Felix Gardner
* 2014.03.10
* ***************/
//#include <conio.h>
#include <stdio.h>
#include <math.h>
#include <stdbool.h>
// Function declarations
bool menu(bool loop);
void main(){
bool loop = true;
while(loop == true){
loop = menu(loop);
}
printf("\n");
}
// Function definitions
bool menu(bool loop){
int selection;
printf("\n This is your menu\n");
printf("\n 0) End\n");
printf("\n Selection: ");
scanf(" %d", &selection);
switch(selection){
case 0: loop = false; return(loop); break;
default: printf("\n Nothing to do with: %d ?\n", selection); break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment