home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!rpi!gatech!prism!federation!andy
- From: andy@federation.gatech.edu (Andy Register)
- Newsgroups: comp.lang.c++
- Subject: Re: Can someone please help me with streams?
- Message-ID: <75249@hydra.gatech.EDU>
- Date: 18 Nov 92 14:33:29 GMT
- References: <1992Nov18.033505.1617@lugb.latrobe.edu.au>
- Sender: news@prism.gatech.EDU
- Organization: CERL-EE, Georgia Institue of Technology
- Lines: 17
-
- In article <1992Nov18.033505.1617@lugb.latrobe.edu.au> ECSC9120802J@LUST.LATROBE.EDU.AU (GRANT,David) writes:
- |>
- |>I a new programmer to c++, and at the moment I am having trouble with streams.
- |>I have overloaded the istream operator >>, to read in character by charater and
- |>copy into an array. (It does a few other things as well.) The trouble I am
- |>having is that I can't get it to recognise spaces or carrage returns. It just
- |>seems to ignore them totally. I was wondering how I can get it to recognise
- |>these characters, as it is inportant to my program.
- ----------------------------------------------------------
- Yep, istream ignores whitespace (blank, tab, newline, formfeed, cr).
-
- Try cin.get() instead. Stroustrup, The C++ programming language, 2nd
- ed., pp. 330-333 has examples.
-
- Toodles
- Andy
-
-