write data to file - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

write data to file

onioni Posts: 3Member
I want the programs for register an login for my program massageboard that write by c/c++. this program use file text-document for storage username and password account
detail of this program
first page
1.register
2.login
3.exit
please select chioce :_
-when register you can not use username that someone had already registered(that storage in file)
-when register must type password 2 times
register page
firstname____________
lastname_____________
username_____________
password_____________
confirmpass__________
after register it loop to firstpage
login page
username_________
password_________
if input username or password incorrect show page incorrect and choice for try again,register or exit
if input correct show page report for account
please help me to write this program and place the sourcecode here
Thank very very much

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    nobody here is going to do your homework for you. Write the code yourself and ask questions, but please don't ask us do to your work. If that's what you want, then you might as well go back home to your mommy.
  • onioni Posts: 3Member
    sorry
    ok now I do this but I have problem in this point
    -how to do if the username that you are registering had already register and wrote in the file .how to do for cheak
    -how to do when login if username that you input does not found
    in file .how to do for check
  • stoberstober Posts: 9,765Member ✭✭✭
    : sorry
    : ok now I do this but I have problem in this point
    : -how to do if the username that you are registering had already register and wrote in the file .how to do for cheak
    : -how to do when login if username that you input does not found
    : in file .how to do for check
    :

    you probably already know the basic file handling functions, such as how to open the file, read a line (or record) and close the file. If you don't, then study up on those topics which you will find in every c or c++ programming book exactly how to do that depends on whether you are writing a c or c++ program.

    after the user enters a user-name, read the file and search for that name. How to do that depends on how you write it. You need to do a little pre-planning about how you want to write the file. It should contain, at a minimum, the user name and password.
  • onioni Posts: 3Member
    I know basic file handling functions such as fscanf fprintf
    but i can not write function to check input username to username in file

  • DonotaloDonotalo Posts: 715Member
    : I know basic file handling functions such as fscanf fprintf
    : but i can not write function to check input username to username in file

    u can load all the names from the file to a string array (i mean char[][] array). then for the name input by the user, search that name within the array.
Sign In or Register to comment.