Hi, I had a problem in printing a String class string to a file where I had declared:
string str1, str2;
And in str1 and str2 has the values which I wanna store the values by writing them to a txt file using the format:
// write to apsignal.txt
cout<<"Error opening apsignal.txt";
//Print to file with the signal strengths and corresponding clientIDs.
fprintf(newfile,"1" " %s" " %s", &str1, &str2 );
however, it seems like it cannot print out the values in the txt file as it is a string class? So I was wondering if anyone can give me other alternatives to write the values into this text file?
Thanks! I had attached the relevant files and pls take a look at the apsignal.txt and you will know what I mean. Thanks for any help!