Computer Science Canada getchar() Help |
Author: | crossley7 [ Thu Oct 27, 2011 9:52 pm ] |
Post subject: | getchar() Help |
Hey after seeing what the issues with this past dwite's first question, I am just wondering if anyone would have an easy way of reading \r\n characters with getline() in a way that doesn't cause it to read through twice and ideally not have to check if string length is 0 when reading in. Either that or dwite should just use \n newline characters to be nice to those who wish to use getline() for similar types of problems. ![]() |
Author: | Tony [ Thu Oct 27, 2011 10:00 pm ] |
Post subject: | Re: getchar() Help |
crossley7 @ Thu Oct 27, 2011 9:52 pm wrote: Either that or dwite should just use \n newline characters to be nice to those who wish to use getline() for similar types of problems.
![]() That doesn't really help. If you assume \n then someone else assumes \r\n. We'd just be shifting the problem to the other group of users. We are currently investigating compilation flags and other compilers to deal with the issue though, as we've been discussing at http://compsci.ca/v3/viewtopic.php?t=29545 |
Author: | S_Grimm [ Mon Oct 31, 2011 8:27 am ] | ||
Post subject: | Re: getchar() Help | ||
This way reads in a string or character or whatever "x" is assigned to, as long as it is streamable. It doesn't duplicate \n and keeps the original formatting of the input file. |