user input into a string

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Feb 2005
Posts: 3
Reputation: fopah is an unknown quantity at this point 
Solved Threads: 0
fopah fopah is offline Offline
Newbie Poster

user input into a string

 
0
  #1
Mar 28th, 2005
i need the user to input a todolist type thing it uses strings to save the items.
what i need to know is how to have the user input a string with the getline function any help would be much appreciated
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,334
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 234
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: user input into a string

 
0
  #2
Mar 28th, 2005
  1. #include <iostream>
  2. #include <string>
  3.  
  4. int main()
  5. {
  6. std::string input;
  7. std::cout << "Enter a string: ";
  8. if ( getline(std::cin, input) )
  9. {
  10. std::cout << "You entered " << input << std::endl;
  11. }
  12. return 0;
  13. }
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 2
Reputation: arshaad is an unknown quantity at this point 
Solved Threads: 0
arshaad arshaad is offline Offline
Newbie Poster
 
-5
  #3
10 Days Ago
elo i would like to knw a few thing so that i could complete my projet can you help me plz.
the question is:
Write a program that performs the following :
1) Input a string( sets of caracters)
2) Convert the string into capital letters
3) Convert the number if vowels and consonent
4) Reverse the string order
Can u reply me plz my email address is ally.arshad@hotmil.com
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 2
Reputation: arshaad is an unknown quantity at this point 
Solved Threads: 0
arshaad arshaad is offline Offline
Newbie Poster
 
-4
  #4
9 Days Ago
ey man hw do we do to input a string?
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC