It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

News

Log In Sponsors
Partner Sites

Another C++ Program that needs to be corrected.



While I was waiting for someone to respond to my other thread i tried to make a program myself. This is what I ended up with.

[code:dd0279hq]// This is a simple "signing in" program.

#include <iostream.h>

main()
{
int med; //This is the username. Note: In digits.
char pass[5]; //This is the password.

char correct = Arman; //Pass has to be equal to Arman in case of a successfull sign in.

cout << "Type in your username \n";
cin >> med;

switch (med) { //The switch starts here
case 12: // I chose that 12 should be the correct username.
cout << "Type in your password \n";
cin >> pass;

if (pass == Arman) {
cout << "You have successfully logged in to your account \n";
}

else {
cout << "Your password was incorrect \n";
}

default:
cout << "There is no such username. Try again by starting the program again. \n\n";

}

return 0;
}[/code:dd0279hq]

[color=red:dd0279hq] char correct = Arman; [/color:dd0279hq]
Unidentified character 'Arman'. <--- Thats the error message.

Dont get why it pops up.

If I get that fixed I would be able to hand in 2 programs. That might make a better impression. My aim is an A+.

Thanks in advance!

Click here to read the whole forum topic