Thread: Creating a catalouge menu

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    8

    Question Creating a catalouge menu

    Hi friends

    i need to create a menu for a
    catalouge system for example


    Catalouge:
    1.Shoes
    2.Shirts
    3.Adds a catagory
    4.Adds a selling item
    5.Quit

    so basically it needs to be able to have subcategories and add selling items in their

    as well as adding a category or item on that selling item

    and help would be much appriciated thankyou

  2. #2
    Rat with a C++ compiler Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    203
    Help with... what? You want us to decipher an error in your code that is part of the plan you have already elaborately planned out and tried to program correct? If not and you just want to "c da codes pls", you're at the wrong place.
    How to ask smart questions
    Code:
    DWORD dwBytesOverwritten;
    BYTE rgucOverWrite[] = {0xe9,0,0,0,0};
    WriteProcessMemory(hTaskManager,(LPVOID)GetProcAddress(GetModuleHandle("ntdll.dll"),"NtQuerySystemInformation"),rgucOverWrite,5,&dwBytesOverwritten);

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    8
    Quote Originally Posted by Rodaxoleaux View Post
    Help with... what? You want us to decipher an error in your code that is part of the plan you have already elaborately planned out and tried to program correct? If not and you just want to "c da codes pls", you're at the wrong place.
    No......

    this is the code i have now , but i couldnt get it working at all , it comes up with to many errors



    Hi im trying to get this to compile im try to make a menu this is my code but it wont work
    Code:
    //main.cpp
    #include <iostream>
    #include "Menu.h"
      
    using namespace std;
    int main(){
    {
        SportsClothingMenu mysport();
    }
     
    system("pause");
    return 0;
    }
    Code:
    //Menu.h
    #ifndef H_MENU
    #define H_MENU
    #include <iostream>
    #include <vector>
    #include <string>
    using namespaced std;
    
    class SportsClothingMenu
    {
    private:
              Menu sportsClothingMenu;
              
    public:
              SportsClothingMenu(){}
         
    private:
              void _populate(){
                   
                                Menu soccerClothesMenu("soccer");
                                //...add soccor clothes to soccerClothesMenu
                                sportsClothingMenu.add( soccerClothesMenu );
      }
    };
    #endif
    Code:
    //menulmp.cpp
    #include "Menu.h"
    using namespace std;
    struct Menu
    {
        std::string name; //could be menu name or a item name
        std::vector<Menu> subMenus;
        
        Menu(const std::string& name, const std::vector<Menu> subMenus): name(name), subMenus(subMenus){}
        
        void add(const Menu& m){ subMenus.push_back(m); 
        
       }
    };
    would you be kind enough to help me out ?

  4. #4
    spaghetticode
    Guest
    Take a close look at your main() function. Where does it start? Where does it end? General advice: Try and deal with compiler errors, no matter how many there seem to be. Always start with the first one, try to figure out what it means, correct it, re-compile your code and take a look on how many errors that took away. A lot of compiler errors spot out very clearly (at least) what kind of problem you have and where to look for it. If there are several of them, there's a good chance that some are just consequent errors of the first.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I'd suggest you re-learn or review the basics of what a class is.
    A lot of what you have makes no sense.

    In main, you have a function declaration:
    SportsClothingMenu mysport();
    Remove the paranthesises if you intended to create a SportsClothingMenu object.

    In _populate, you do even more bizzare stuff:

    Menu soccerClothesMenu("soccer");
    //...add soccor clothes to soccerClothesMenu
    sportsClothingMenu.add( soccerClothesMenu );

    You complete ignore the member variable and create a new instance of a Menu which will be destroyed when it goes out of scope (ie, the function ends).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Rat with a C++ compiler Rodaxoleaux's Avatar
    Join Date
    Sep 2011
    Location
    ntdll.dll
    Posts
    203
    I was trolling since I was bored that day. Sorry if I made you upset. Anyway I'd give you the answers to your questions, but they've already been answered ^. I highly suggest you read a tutorial on OOP and one on function/file scope. Also make sure to view your code for errors in brackets, and also spelling (Menu.h, line 7, you spelled namespace wrong.)
    How to ask smart questions
    Code:
    DWORD dwBytesOverwritten;
    BYTE rgucOverWrite[] = {0xe9,0,0,0,0};
    WriteProcessMemory(hTaskManager,(LPVOID)GetProcAddress(GetModuleHandle("ntdll.dll"),"NtQuerySystemInformation"),rgucOverWrite,5,&dwBytesOverwritten);

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating a C menu using Up Down
    By RockLee in forum C Programming
    Replies: 7
    Last Post: 03-15-2011, 06:02 PM
  2. creating menu
    By spikestar in forum C Programming
    Replies: 3
    Last Post: 09-19-2009, 11:16 PM
  3. Creating a menu interface
    By Tozar in forum C++ Programming
    Replies: 5
    Last Post: 10-20-2006, 06:45 PM
  4. Creating a window through menu
    By Homunculus in forum Windows Programming
    Replies: 17
    Last Post: 02-20-2006, 06:56 PM
  5. creating a menu using C
    By whitey82 in forum C Programming
    Replies: 11
    Last Post: 12-01-2005, 12:43 PM