![]() If I change the delimiters to the strtok call to "\r\n", it works for me. The other part: when I compile it on OS X using gcc, and I run it: the \r is still included in the tokenized string, because it obviously splits on \n. Which I think is weird, because I can not find any documentation on this behavior. ![]() So, compiling this with the Microsoft C compiler from Visual Studio and running it on Windows splits the file correctly on newlines ( \r\n). However, the file adfgx.txt (which is provided for the assignment) has Windows style newlines ( \r\n): I checked it with a hex editor. ![]() The code provided by the tutors splits the contents of a file on \n using this code: /* Read ADFGX information */ While the other students working on Windows don't have problems reading a file, I do. I'm working on a C school assignment that is intended to be done on Windows, however, I'm programming it on OS X.
0 Comments
Leave a Reply. |