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

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.

Thank you very much for your helping hand.

Thank you again!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.