0

I am trying to declare a stringstream to use to reverse a number to see if it is a palindrome (input is an int passed into the function)-

stringstream ssInput;
ssInput << input;
string reverseInput = ssInput.str();

I modeled it after this question -

Easiest way to convert int to string in C++

Why am I getting this error?

aggregate 'std::stringstream ssInput' has incomplete type and cannot be defined| ||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

Community
  • 1
  • 1
Noah Gonzales
  • 31
  • 4
  • 9

1 Answers1

3

Have you included

#include <sstream>

? It should also be needed to add using namespace std or to use fully qualified name std::stringstream instead of simply stringstream.

Francesco Argese
  • 626
  • 4
  • 11