My guess is that there is a stray '\r' in there which might be why it is different on windows and linux. A carriage return will cause the cursor to go to the start of the line, which would be why the "<--" is at the start of the line instead of after the string.
How are you reading the data into the Database array? That's likely where the problem (or at least the solution) is.
You are probably printing back-spaces or some other "move the cursor" characters that happen to be the rubbish in some un-initialized variable - that would be my theory at least.
Originally Posted by kyaky
When you read a file in text mode, the carriage returns and linefeeds are automatically converted to a single character: '\n'. In binary mode that doesn't happen, though, so you may get different behavior depending on your platform.
Did you edit the file that has the records by hand (i.e. in an editor outside of your code)?
the txt is that:
the reading is:
C++ for Beginners
25 9 1999
i think the reading has problem... but i dunno how to read... was i right to write like that?
for (int i = 0; i < MaxDueDate; i++)
if (Database[NumBooks].DueDate[i] == ' ')
Database[NumBooks].DueDate[i] = '/';
cout << "Txt file was successfully loaded!" << endl;
Finally!!!! i found where the problem was... such a stupid i made again... the txt file has something wrong... because i made this txt file in windows it has 0D(CR) in this file... it made me crazy!!! i will be my biggest lesson in my life up to now... thank you alot... i love you guys!!!!!
6:15 am ... i can go to bed finally!!!!! OMG!!!