std string with getline

This is a discussion on std string with getline within the C++ Programming forums, part of the General Programming Boards category; I tried to use cin.getline to take input into a std string and it didnt work I tried using .c_str() ...

  1. #1
    Stinking it up. StinkyRyan's Avatar
    Join Date
    Jun 2004
    Posts
    61

    std string with getline

    I tried to use cin.getline to take input into a std string and it didnt work I tried using .c_str() and it still didnt work. should I just use cin>>

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,673
    "getline(cin, str)" where str is of type std::string and cin is of type std::istream

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Custom String class gives problem with another prog.
    By I BLcK I in forum C++ Programming
    Replies: 1
    Last Post: 12-18-2006, 02:40 AM
  2. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  3. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 02:23 PM
  5. creating class, and linking files
    By JCK in forum C++ Programming
    Replies: 12
    Last Post: 12-08-2002, 01:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21