Thread: creating menu

  1. #1
    Registered User
    Join Date
    Jul 2009
    Posts
    38

    creating menu

    Hi guys, I am meant to create a menu for some void functions:

    Code:
    		case 1: displayBooks();
    		break;
    Code:
    void displayBooks(BookListType* booklist)
    {
    }
    I'm just not sure how I'm supposed to call the displayBooks function through the menu.
    Any help would be much appreciated.

    Regards
    S.S

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Just as you have it (except for putting the booklist between the parentheses).

  3. #3
    Registered User
    Join Date
    Jul 2009
    Posts
    38
    When i compile i get an error message saying expected expression before BookListType

  4. #4
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804
    Quote Originally Posted by spikestar View Post
    Hi guys, I am meant to create a menu for some void functions:

    Code:
    		case 1: displayBooks();
    		break;
    Code:
    void displayBooks(BookListType* booklist)
    {
    }
    I'm just not sure how I'm supposed to call the displayBooks function through the menu.
    Any help would be much appreciated.

    Regards
    S.S
    I didn't understand your question correctly. There can be two things:
    1. You want the function to take no arguments. If that's true then remove the highlighted line.
    2. You want the function to take a pointer. If that's the case then pass a pointer(an address) while calling in case 1(inside the paranthesis). For eg. display(any_pointer);
    HOPE YOU UNDERSTAND.......

    By associating with wise people you will become wise yourself
    It's fine to celebrate success but it is more important to heed the lessons of failure
    We've got to put a lot of money into changing behavior


    PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
    IDE- Microsoft Visual Studio 2008 Express Edition

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2009, 10:25 AM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  4. Creating a menu system
    By ICool in forum C Programming
    Replies: 9
    Last Post: 09-17-2007, 12:18 PM