-
March 23rd, 2011, 03:48 PM
#1
handle user input of unknown size
how to implement an acceptance of unknown input size (during console entry by user) in a char array, like the way std::string does? (m using gcc/g++ under ubuntu)?
-
March 23rd, 2011, 04:15 PM
#2
Re: handle user input of unknown size
see the code starting on page 3 from the Stroustrup paper
on learning C++ ...
http://www2.research.att.com/~bs/new_learning.pdf
-
March 23rd, 2011, 04:31 PM
#3
Re: handle user input of unknown size
my understanding of getchar() was a bit different...i thought getchar() gets a character from the user and requires <CR> to be pressed after every char. input...getch() under curses library with line-buffering off does it..however i wanted it without any additional libraries if possible...but bjarne wrote that so i think its my understanding that's a bit off...can u explain.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|