0

Hi, I am having problem in getting a menu' on the screen by using a function. At the compiling time I do not get any error but at the running one it doesn't produce any result. Here the code:

#include<stdio.h>

void day_menu();

int main()
{
 day_menu;
  return 0;
}
  void day_menu()
  {
    printf("Case 1: Monday\n");
    printf("Case 2: Tuesday\n");
    printf("Case 3: Wedensday\n");
    printf("Case 4: Thursday\n");
    printf("Case 5: Fryday\n");
    printf("Case 6: Saturday\n");
    printf("Case 7: Sunday\n");
    printf("Case 8: Exit\n");
    return;
  }
Is there anyone able to tell me the problem?

Thank you very much
2
Contributors
2
Replies
4
Views
6 Years
Discussion Span
Last Post by fab2
0

line 7 is not calling a function. You have to put () after the function name, such as day_menu(). You will also want to put something just before the return in main() (such as getchar()) to make the program stop so that you can see what is on the screen. If you don't the os will probably erase the screen immediately after the program has ended.

Edited by Ancient Dragon: n/a

0

Thank you very much for your helping hand.

Thank you again!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.