Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
int main()
{
std::string data("Using istringstream\
\nmakes splitting a string easy\
\nwhen in C++");
std::istringstream origStream(data);
std::vector<std::string> lineList;
std::string curLine;
while (std::getline(origStream, curLine))
{
// Only add non empty lines.
if (!curLine.empty())
lineList.push_back(curLine);
}
// Output vector.
std::copy(lineList.begin(), lineList.end(),
std::ostream_iterator<std::string>(std::cout, "\n"));
}
while (std::getline(origStream, curLine[red], '\r'[/red]))