Well I saw another post on this site of a guy making something that will tell him a list of phone numbers when he put in the correct password. I'm trying to edit it so after putting in a correct password it asks you for a name, then you type the name and it lists the number. The password works fine, but when I type in a name it closes the program. This is my first time using Chars and I dunno what the heck I'm doing.
Help would be appreciated.Code:#include <iostream> using namespace std; int main() { float password; char number[10]; char Nameone; char Nametwo; cout<<"Enter the password: \n"; cin>>password; if (password == 1337) { cout<<"What number are you requesting?\n"; cin>>number[10]; } else if (number[10] == Nameone) cout<<"The number is ***-****\n"; else if (number[10] == Nametwo) cout<<"The number is ***-****\n"; cin.ignore(); cin.get(); return 0; }![]()



LinkBack URL
About LinkBacks



