What is the best way to add a '\r' to my new-line sequence? I am writing a string to a file and doing various parsing to it but according to my assignment spec a new line will be considered '\r\n'.
Right now I only have a new line at the end. I was thinking of a for loop and/or using memmove but not sure exactly how to make it work?
for (int x = 0;x < strlen(string);x++)
{
if (string[x] == '\n')
{
..............
}
}