Cabdullahi
IB Legend
- Messages
- 5,610
- Reaction score
- 1,308
- Gender
- Male
- Religion
- Islam
Anybody here good at c++...ive designed a password function but its kinda useless....it doesnt compare it with the a set password....basically im kinda wack at this maybe some1 could help me 
here's the code
// hndfh.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
// 00000.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include <windows.h>
using namespace std;
int main ()
{
cout << "Enter you password: (max 4 characters)" << endl;
// password (char array, doesn't work as string)
char password[25];
int i = 0; // used to index the current character being read
while (true) // infinite loop, broken by pressing return
{
password = getch(); // get the current character
cout << "*"; // output a star (can be replaced with a different character)
if (GetAsyncKeyState(VK_RETURN)) // if return has been pressed
break; // break from the loop
i++; // increment our index
}
// now fill the rest of the array with '\0' (NULL) character
for (i; i < strlen(password); i++)
password = '\0';
// output the password (just for testing)
cout << endl << "Welcome Ahmed Ali";
// end of the program
cout << endl << "Press any key to continue . . .";
getch ();
}

here's the code
// hndfh.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
// 00000.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include <windows.h>
using namespace std;
int main ()
{
cout << "Enter you password: (max 4 characters)" << endl;
// password (char array, doesn't work as string)
char password[25];
int i = 0; // used to index the current character being read
while (true) // infinite loop, broken by pressing return
{
password = getch(); // get the current character
cout << "*"; // output a star (can be replaced with a different character)
if (GetAsyncKeyState(VK_RETURN)) // if return has been pressed
break; // break from the loop
i++; // increment our index
}
// now fill the rest of the array with '\0' (NULL) character
for (i; i < strlen(password); i++)
password = '\0';
// output the password (just for testing)
cout << endl << "Welcome Ahmed Ali";
// end of the program
cout << endl << "Press any key to continue . . .";
getch ();
}