So guys I'm a noob and I'm stuck I just need to know where I've gone wrong Here is the code (ignore the friends_name that's fine)
char friend_sex [1];
cout << "Please enter m if your friend is male or f if your friend is female\n";
cin >> friend_sex;
if (friend_sex == "m") cout << "If you see " << friends_name << "! please ask him to call me\n";
if (friend_sex == "f") cout << "If you see " << friends_name << "! please ask her to call me\n";
When I run it it says "Run-Time check failure #2 - stack around the variable 'friend_sex' was corrupted."
Any help would be appreciated :)
Aucun commentaire:
Enregistrer un commentaire