Question

I'm note sure about conventions for different types of line termination in different programming languages. I know that there are 2 types, 1: line feed, 2: carriage-return, line feed. My question is: how does readline in different programming languages, like python: a = fd.readline();, c/c++: file.getline (buffer,100);, java: line = buf.readLine(); deal with line termination? If they are sensitive to these 2 different types of terminations, how do I treat them separately?

Was it helpful?

Solution

You mostly don't need to worry about it. If you come to a point when something doesn't work, come back and ask about that.

Note however that what determines the line-ending convention is not which programming language you use, but the platform it runs on (*nix/Windows/Mac, all are different).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top