DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   user input into a string (http://www.daniweb.com/forums/thread21016.html)

fopah Mar 28th, 2005 1:12 pm
user input into a string
 
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

Dave Sinkula Mar 28th, 2005 1:33 pm
Re: user input into a string
 
#include <iostream>
#include <string>

int main()
{
  std::string input;
  std::cout << "Enter a string: ";
  if ( getline(std::cin, input) )
  {
      std::cout << "You entered " << input << std::endl;
  }
  return 0;
}

arshaad Nov 11th, 2009 3:21 pm
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

arshaad Nov 13th, 2009 2:38 am
ey man hw do we do to input a string?


All times are GMT -4. The time now is 12:28 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC