Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
string input
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
coinjo
#1
string input
Feb 28 '06, 01:15 PM
Can anyone please tell me how to take input from user of random length
and then display it?
Ben Pope
#2
Feb 28 '06, 01:25 PM
Re: string input
coinjo wrote:[color=blue]
> Can anyone please tell me how to take input from user of random length
> and then display it?[/color]
Random length?
I presume that you mean they can use any number of characters, followed
by some kind of terminating character.
Take a look at
std::string, std::getline, std::cin and std::cout
from these headers:
<iostream>
<string>
That allows the user to enter a line (a string terminated with a
carriage return), read it into a string, and then display that string.
This should be described in your favourite C++ reference.
Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment