Over the past few days I have been searching literally everywhere for an answer to this question: How do you output a stings contents into a char*? I am creating a username/password system were you can register yourself, or log into an account you have already registered. In the main program I have it copy the username and password onto a txt file when you register. If you log in, it searches for your username throughout the txt file and finds the next line (the password). Then it compares what you put in as your password and what your registered password is. I created this short program just testing how to find the line after a certain word. Then i realized I need to have it use a string instead of a random word in parenthesis. Here is the short program that pulls the line following what you search for. Sorry if code is messy. :(
Yanson, I tried the string copy method and all went well until I got to the part of the program where it puts the sting into the char*. The moment you type in the username and click enter it asks to close the program due to errors. Here is the code I used:
Cire, I don't know how that would work, that is why I constructed the program the way I did. If you know how to do that, I would appreciate it if you posted a program that does what I am trying to accomplish.