Hey, I was bored and had not made a program for a short while so decided to make one, Just have a few questions and some "How do you.." questions, well heres my code..
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int registerID, ID;
char name[20];
char choice;
ofstream file;
file.open("identification.txt");
cout << "Do you wish to create a new account?";
cin >> choice;
if( choice == 'y' || choice == 'Y' )
{
cout << "Please register a number I.D : ";
cin >> registerID;
cout << endl << "Thanks, now what is your name?";
cin.getline( name, 20);
file << registerID << name;
}
else if( choice != 'y' || choice != 'Y' )
cout << "What is your I.D? : ";
cin >> ID;
cout << endl << "Welcome " << name;
return 0;
cin.get();
cin.get();
}
Just i'm not sure how i would access the i.d's in the file and check if they actually exist, many thanks