automatically end program error

#include <iostream>
#include <string>
#include <windows.h>
#include <conio.h>
using namespace std;

wronginput(), pwun(), pwheader();
string pwpw();
string un;

wrongun()
{
cout<<"\n\nWrong username!\n\n";
system ("cls");
return 0;
}

wrongpw()
{
cout<<"\n\nWrong password!\n\n";
system ("cls");
return 0;
}
pwun()
{


cout<<" USERNAME: ";
cin>>un;

if (un!="masteraryhan")
wrongun();

return 0;
}

pwheader()
{
cout<<"\n\n\n Please Log-in\n\n";
return 0;
}

class Password /* Password class... will store all necessary data */
{
protected: /* A password should be protected, right? */
string password; /* The string to store the password */
string input; /* The string to store the input */

public:
/* Constructor, pass a string to it (the actual password) */
Password (string pass) {this->password = pass;}
void Input () /* Get the password from the user */
{
while (true) /* Infinite loop, exited when RETURN is pressed */
{
char temp;
temp= getch (); /* Get the current character of the password */
if (GetAsyncKeyState (VK_RETURN)) /* If the user has pressed return */
return; /* Exit the function */
input += temp;
cout << '*'; /* Print a star */
}
}
bool Compare () /* Check if the input is the same as the password */
{
if (password.length() != input.length()) /* If they aren't the same length */
return false; /* Then they obviously aren't the same! */
for (unsigned int i = 0; i <= input.length(); i++)
{ /* Loop through the strings */
if (password[i] != input[i])
return false; /* If anything is not a match, then they are not the same */
}
return true; /* If all checks were passed, then they are the same */
}
};

string pwpw()
{


Password pass ("ilove03"); /* Assign password a value with our constructor */
cout<<" PASSWORD: ";
pass.Input (); /* Get the input from the user */

if (pass.Compare()) /* If they match, user could gain access to something */
cout << "\nThat's correct!";
else /* Otherwise, give them some abuse! */
wrongpw();

cin.get (); /* Pause for input */
return EXIT_SUCCESS; /* Program was executed successfully */





return 0;
}

main ()
{

do{
pwheader();
pwun();
}while(un!="masteraryhan");
pwpw();
}


what is wrong with this?
what is wrong with this?


No code tags ;)
main returns an int in C++
not only main is missing return type. Almost all you function are missing return types.
closed account (zb0S216C)
Note that <conio.h> is a deprecated header.

Wazzak
Topic archived. No new replies allowed.