How can i put standart input's every word to a vector?

This is a discussion on How can i put standart input's every word to a vector? within the C++ Programming forums, part of the General Programming Boards category; How can i put standart input's every word to a vector?...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    15

    How can i put standart input's every word to a vector?

    How can i put standart input's every word to a vector?

  2. #2
    The larch
    Join Date
    May 2006
    Posts
    3,573
    Code:
    std::vector<std::string> v(std::istream_iterator<std::string>(std::cin), std::istream_iterator<std::string>());
    Or post your attempt?
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    15
    Found.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C programing
    By flame82 in forum C Programming
    Replies: 2
    Last Post: 05-07-2008, 02:35 PM
  2. Gauss-Jordan Matrix Inversion in C++
    By Max_Power82 in forum C++ Programming
    Replies: 3
    Last Post: 12-03-2006, 07:31 PM
  3. stop a recursion
    By acosgaya in forum C++ Programming
    Replies: 5
    Last Post: 10-31-2006, 09:46 AM
  4. Need some help/advise for Public/Private classes
    By nirali35 in forum C++ Programming
    Replies: 8
    Last Post: 09-23-2006, 12:34 PM
  5. Using 'if' with char arrays or string objects
    By c++_n00b in forum C++ Programming
    Replies: 36
    Last Post: 06-06-2002, 09:04 PM

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