Asked • 05/29/19

Correct way to write line to file?

I'm used to doing `print >>f, "hi there"`However, it seems that `print >>` is getting deprecated. What is the recommended way to do the line above?Update:Regarding all those answers with `"\\n"`...is this universal or Unix-specific? IE, should I be doing `"\\r\\n"` on Windows?

1 Expert Answer

By:

James L. answered • 05/29/19

Tutor
5 (1)

Harvard PhD Student for Computer Science / Programming Tutoring

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.