hi there, i have created a unix-like login system by using c++ and it works fine for the first execution but when i close and execute it again. it gives me error where i cant login with the stored username and password. how can i fix this?
here is my code:
#include <iostream> // cout, cin
#include <fstream> // read and write to files
#include <conio.h> // getchar()
#include <io.h> // check file existence
#include <string> // use strings ?
using namespace std; // so we can use cout instead of std::cout
void checkpassfile(); // function to check password file .....
void menu(); // displays menu ie: lock system, change pass etc...
char user[30],usr[30];
char password[30], pass[30]; //... two variables, 1 holding user pass & other holding real pass
int attempts=0; // holds incorrect attempt numbers
Please use code tags so your code is readable
A unix like login and your using conio.h !!! wtf I almost dropped dead....
DON'T USE IT! it's so so so bad, outdated and not even supported by unix/mac systems let alone most windows.(The current windows API is much better, if you want to be windows only)
Don't use system commands. there's many many posts why, check out the search. http://www.cplusplus.com/forum/articles/11153/