do i have to declare a string that equals a string in the text file? kinda like in fstream when you use this:
ifstream passwrd ("password.txt");
cout << str;
passwrd.close();
Type: Posts; User: Warhawk
do i have to declare a string that equals a string in the text file? kinda like in fstream when you use this:
ifstream passwrd ("password.txt");
cout << str;
passwrd.close();
oh duh! that makes sense! thanks!
but one last problem --> what method would i use to verify whats in the textfile? I know you have to do a ifstream to the file but im having the problem of how...
ok ok... wait -- what im really asking is this --> how would i be able to verify that a text file is present or if it does not exist?
system("cd desktop");
system("cls");
ifstream verpass ( "password.txt" );
if (
string pass;
cout << "Please Enter Your Passsword: ";
cin >> pass;
ofstream passfile ( "password.txt" );...
actually, that would be nice too -- but i meant at the beginning of the code (source)
ok, but how would i verify the data in the text file... i can get it to store the password, it asks you to reenter and it verifies it, but i am getting confused in how to implament that same code...
ok -- like, when you enter the "password", it says something like Yay! and then it asks you if you want to change your "password", if you choose yes, then it says enter new "password" and when you...
well, i understand I/O to a point, i was wanting to be able to validate user input. I checked out the validate user input in the FAQ, but it was not what i was looking for. Thats what i am really...
Ok, i was wondering if there is a site i can go to so i can learn to recall data from a text file or store data within the program.
example: Enter Name: Bob
"stores name"
...
ok, i played around with my code and i got it to work, thanks for all your help guys!
still no luck -- error message reads: "no matching function for call to `strcmp(std::string&, const char[7])' "
how would i fix this
then why doesnt it work? i tried that and it still goes to the part of password incorrect. Does it have to do with the preprocessor? i tried it with a similar program that show what you typed in the...
it still dont work, and i thought for a string to be classified as true, you had to use if(strcmp (pass1, "password") == 0)
if your wanting to run in a normal CMD window, use the system("color xx") function.
to see the list of colors, open command prompt and type color ?/
ok, i got to thinking, why not make a fake login screen for fun, since i was looking at a lesson in my book (not school) and it was talking about preprocessor directives, and it just so happens it...
thanks alot, that clears up alot of stuff! the explanation in the first link was great!
no help... gosh i feel loved
but the data still will not show on the screen like he was wanting, thus rendering the use of 'int' useless. But i agree with the first statement -- programs are told what to do and follow orders as...
yea, lke the post above, instead of using an integer, which can only work with numbers, you must use a string. Also, you must use cin.get(); to keep the window from disappearing. cin.get(); waits...
that is true -- ILoveVectors helped me through my programming days, but what did he do?
it could be... you pose a good point
basic C++ program using dev-C++
this is just a demo... that is where the code is supposed to go, right?
heres some code i picked up, but im having a problem with it:
#include <iostream>
#define WINDOW_WIDTH 640 //sets window width
#define WINDOW_HEIGHT 480 //sets window height
...
programmers are geeks ------ no one can get around that