Thread: Function call

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    693
    Make your prototype like this
    Code:
    void sale_menu(int* menu)
    and pass it in main like this
    Code:
    sale_menu(&getMenu);
    But then you will have to change your scanf in your function to
    Code:
    scanf("%d", menu);
    Read up on pointers
    Last edited by camel-man; 10-28-2012 at 05:39 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 09-22-2011, 09:59 PM
  2. Replies: 8
    Last Post: 07-08-2011, 01:16 PM
  3. How to call a function from a function pointer
    By Richardcavell in forum C Programming
    Replies: 9
    Last Post: 02-16-2011, 04:22 AM
  4. Replies: 5
    Last Post: 10-17-2006, 08:54 AM
  5. Replies: 2
    Last Post: 06-21-2005, 02:41 PM