Guest User

Untitled

a guest
Nov 25th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int menu(void);
  4. char redirector(selection);
  5. int loadimage(void);
  6. int removeimage(void);
  7.  
  8. int main(void)
  9. {
  10. menu();
  11. return 0;
  12. }
  13.  
  14. int menu()
  15. {
  16. char selection;
  17. printf("*****OPTION*****MENU*****\n");
  18. printf("L: Load image\n");
  19. printf("R: Remove image\n");
  20. printf("P: Print image\n");
  21. printf("A: Average image\n");
  22. printf("H: Horizontal derivative\n");
  23. printf("V: Vertical derivative\n");
  24. printf("T: compute hisTogram\n");
  25. printf("D: search Digram\n");
  26. printf("M: local Maxima\n");
  27. printf("Q: Quit program\n");
  28. printf("*************************\n");
  29. printf("Select an option: ");
  30. selection = toupper(getchar());
  31. printf("%c",selection);
  32.  
  33. redirector(selection);
  34. return;
  35. }
  36.  
  37. char redirector(selection)
  38. {
  39. if (selection == L)
  40. {
  41. loadimage();
  42. }
  43. else if (selection == R)
  44. {
  45. removeimage();
  46. }
  47. }
  48.  
  49.  
  50. int loadimage()
  51. {
  52. printf("Congrats. You've gotten to load image.")
  53. }
  54.  
  55. int removeimage()
  56. {
  57. printf("Congrats. You've gotten to remove image.")
  58. }
Add Comment
Please, Sign In to add comment