Code:
char *src = "hi\r\nworld";
FILE *fstream = fopen ("test.txt", "w");
fwrite (src, 1, strlen(src), fstream);
fclose (fstream);
char *src = "hi\r\nworld";
FILE *fstream = fopen ("test.txt", "w");
fwrite (src, 1, strlen(src), fstream);
fclose (fstream);
on ce od jednog \r da napravi 2 \r, pa ce fajl da izgleda ovako:
68 69 0D 0D 0A 77 6F 72 6C 64
Dva puta 0D.
Da li sam ja neobavesten, pa koristim pogresnu funkciju (mozda treba write() umesto fwrite() ?), ili je ovo bug u kompajleru ?