Tak jak w temacie, przy próbie zkompilowania programu w który m znajduje się wywołanie metody to_string(), wyskakuje błąd:
...plik.cpp||In function 'int main()':|
...plik.cpp|8|error: 'to_string' was not declared in this scope|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===
Mam taki kod:
#include <iostream>
#include <string>
using namespace std;
int main(){
int x = 5;
string s = to_string(x);
cout << s;
return 0;
}
Wiem że do cout nie potrzebuje typu string, ale chcę na zmiennej s wykonać inne operację.
Bardzo proszę o pomoc.