I am coding in Eclipse and have something like the following:
#include <ftream>
#include <iostream>
void read_file(){
char buffer[1025];
std::istringstream iss(buffer);
}
However, when I try to build, I get the following error: variable 'std::istringstream iss' has initializer but incomplete type
Any quick thoughts? I have googled around and it seems like most people with this problem simply did not include the right header files which I believe I am doing correctly.
std::istringstring
? It's in the <sstream>
header anyway, though.
#include<fstream>
instead of #include <ftream>
@Aneem
You need this include:
#include <sstream>
` Please include either of these:
`#include<sstream>`
using std::istringstream;
Success story sharing
sstream
header must be included to usestd::istringstream
. en.cppreference.com/w/cpp/io/basic_istringstreamgcc
error message, which is not helping the programmer to abide by the standard.