How do I take output from a stream and link directly into cout.
For example: inStream >> cout... This doesn't actually work through. PLZ HELP
How do I take output from a stream and link directly into cout.
For example: inStream >> cout... This doesn't actually work through. PLZ HELP
I think rdbuf() helps you:
#include <iostream>
#include <sstream>
#include <fstream>
int main()
{
std::istringstream input{ "Some content" };
std::cout << input.rdbuf();
std::ifstream file{ R"(b:\test.txt)" };
std::cout << file.rdbuf();
}