hi guys im new in this forum and im searching for a code to learn about using "ifstream and ofstream" thats when i came upon this forum..
im a newbie when it comes to coding so thats why i need some help..
we are to create a login program in c++ using those above and i dont know where to start..
this is what our prof output:
.................................................................................................... ....................
Username:
Password:
1.choose a different username:
2.choose a different password:
3.Exit
.................................................................................................... ....................
might be simple to others..
the thing is he said that if the username or password is incorrect, meaning it woud not login.. and should show that the username or password is wrong..
he uses "if, while, else"
he also used "switch"
i think he opened a different source file for each in "username, password and switch"
i dont know how did it.. and the username and password shows up in 2 different notepad and automatically updates itself when changing username and password..
if someone can help me with this it will be deeply appreciated.. tnx guys..
This is not a hard program, as you said, but you have to know some things if you want to understand it like functions, strings and FILE pointers.
The notepad file updates itself because the way you write in the file makes that. You have to write in the file with the append-mode. And to do that you have to open the file in append mode like this: pointer_file=fopen("namefile.txt", "a+");. The thing is: if you don't know that things, learn them from the refrence of that site (for instance) because if you try to do this kind of programs without knowing those things, you will make a bad idea about programming. If you know those things wiil be much easier to implement the program.