Hello, I am somewhat I newbie to C++ programming and I require some help with this. I am writing a simple organizer program but I run into a problem: I run it and it gives me the main menu, and I enter an option, but then it just blows off the option number and gives me the next function in the code. Here is the code:
life.cpp
main.cppCode:#include <iostream.h> #include "menu.cpp" using namespace std; int main() { int answerget; startmenu(); cin >>answerget; if (answerget = "1") contactsmenu(); if (answerget = "2") notepadmenu(); if (answerget = "0") cout << "\nGood Bye\n"; return 0; }
Can anyone help me out?Code:void startmenu() { cout << "\nWelcome to Life V.00001"; cout << "\n Select option number:"; cout << "\n[1]Contacts"; cout << "\n[2]Notepad"; cout << "\n[0]Quit\n"; } void contactsmenu() { int contactmget; cout << "\n CONTACTS--"; cout << "\n\n[A]List Contacts"; cout << "\n[B]Add Contact"; cout << "\n[C]Edit Contact"; cout << "\n[Q]MainMenu\n"; cin >> contactmget; if ( contactmget = 0) startmenu(); } void notepadmenu() { int notepadmget; cout << "\n NOTEPAD--"; cout << "\n\n[1]New File"; cout << "\n[2]Open File"; cout << "\n[0]MainMenu\n"; cin >> notepadmget; if ( notepadmget = 0) startmenu(); }



LinkBack URL
About LinkBacks


