
-----------------------------------
crossley7
Thu Oct 27, 2011 9:52 pm

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. :P

-----------------------------------
Tony
Thu Oct 27, 2011 10:00 pm

Re: getchar() Help
-----------------------------------
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. :P
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

-----------------------------------
S_Grimm
Mon Oct 31, 2011 8:27 am

Re: getchar() Help
-----------------------------------
[code]

#include 
#include 
#include 
#include 
#include 
#include 
#include 
using namespace std;

int main(int argc, char *argv[])
{
	if (argc != 3)
	{
		cout 