c++ - How read Linux or Mac created file in Windows via C FILE*? -


as know in windows eol crlf , in linux lf , cr in mac. (more_info)

i want write program reads linux , mac win files line line in windows. open file use fopen in "rt" mode, don't know how read lines. fgets reads until crlf , lf under windows want work eol=cr files also.

so solution? in advance.

to open in "t" mode, file must conform platform running on. otherwise have open in binary mode, , sort difference out yourself.

the c library helps write program works same on different platforms, not support "cross reading" files.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -