Try using getline() into a string instead of the extraction operators. The extraction operators stop at whitespace and will ignore any leading whitespace they find, IIRC.
I actually need to use the << operator.. Is there any other way other than getline().. and also I need to manipulate all the characters in the file by adding 5 to the ascii values of each character and print them ... So I wanted to copy the whole file into another file. Is there a way?