|
From: Ioannis V. <no...@ya...> - 2000-10-26 21:21:35
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of > Chris Bunney > Sent: Thursday, October 26, 2000 10:38 PM > To: dev...@li... > Subject: [Dev-C++] using getch with cin. > > > Hi everyone. > > I wrote a function using dev c that overloads the insertion operator for a > class. I used the getch() function within this function and everything > worked fine. > > However, when I took this code to college the next day and > compiled it under > MS Vusual C++ it caused all sorts of problems. My lecturer said > this was to > do with getch using different buffers that cin. > > Is there a way to make sure that getch will work with cin on all > compilers? No, since getch() is not part of ANSI C++. Also it is not even part of ANSI C, so any program using getch() is not considered portable. Ioannis _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |