Search
 
SCRIPT & CODE EXAMPLE
 

CPP

cpp iterate words of string

#include <iostream>
#include <sstream>

std::string input = "This is a sentence to read";
std::istringstream ss(input);
std::string token;

while(std::getline(ss, token, ' ')) {
    std::cout << token << endl;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: matrix layout in C++ 
Cpp :: eosio get time 
Cpp :: tostring c++ 
Cpp :: fast input and output c++ 
Cpp :: C++ Kilometers Per Hour to Miles Per Hour Conversion 
Cpp :: factore of 20 in c+ 
Cpp :: c++ cmd program run in background 
Cpp :: Return multiple values from a function using pointers 
Cpp :: c++ split long code 
Cpp :: max element in vector c++ 
Cpp :: how to get the player view point location and rotation in ue4 c++ 
Cpp :: how to writt array in c++ 
Cpp :: c++ string to double 
Cpp :: finding size of columns and rows in 2d vector c++ 
Cpp :: c++ vector add only unique elements 
Cpp :: using find in vector c++ 
Cpp :: Sort array using inbuilt sort function in decreasing order 
Cpp :: clang cpp compile command 
Cpp :: c++ rule of five 
Cpp :: c++ int to string 
Cpp :: create random vectors c++ 
Cpp :: opencv rgb to gray c++ 
Cpp :: how to copy one vector to another 
Cpp :: c++ hours minutes seconds 
Cpp :: access part of string in c++ 
Cpp :: c++ return multiple values 
Cpp :: int to string c++ 
Cpp :: change integer to string c++ 
Cpp :: push_back struct c++ 
Cpp :: arduino funktion 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =