• C

Carriage return characters from pc to unix

I cannot get rid of the ^M characters at the end of each line when I write a file from my C code.  I am writing the application on a PC using Visual 5.0 and viewing the output files on Unix.  I have tried the binary call "fwrite" but
the characters end up there anyway.  How do I stop this?!
If I write the entire file in binary will that make any difference?
eesAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ylConnect With a Mentor Commented:
ees,

If you open the file in binary mode and append the '\n' character to each line, the the file will be in Unix format.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.