I've got 2 char arrays as follows:
password[80];
message[80];
I want to write them to a file ONE AT A TIME. First the password onto the 1st line of the file. Then the message onto the second line of the file.
I've tried the following with put(). The program crashes. I also tried write()
e.g. outfile.write(password,80); This crashes too.
Code:i = 0; while(password[i] != '\0') { fout.put(password[i]); i++; } AND i = 0; while(message[i] != '\0') { fout.put(message[i]); i++; }
Help please?