So I'm getting acquainted to C++ and have this problem when writing to a text file it also writes the memory location? here is my source code.
int studentID = rand() % (99999 - 4 * 55) + 5 / 2;
std::string studentIDString = std::to_string(studentID);
userprefs.open("studentInformation.txt", std::ofstream::out | std::ofstream::app);
std::cout << "The Student ID is sID-"+ studentIDString +" (Copy everything including the sID.\nyou can also find this in the studentInformation.txt file.)"<< std::endl;
userprefs << std::cout << "the sID is sID-"+ studentIDString << std::endl;
0x804b164 the sID is sID-33921
You are not supposed to do
userprefs << std::cout. It is writing the address of
std::cout in the file.