#include <iostream>
using namespace std;
int main()
{
int num,calculation=0;
cout << "Enter an integer: ";
cin >> num;
stringstream ss;ss <<*num;string str = ss.str();cout << "Digits: ";
for (int i = 0; i < str.size(); i++){ cout << str[i] <<"n";}
return 0;
}
Teşekkürler hocam ama compile edemedim.
aldığım hata:
Alıntı
12:14: error: aggregate 'std::stringstream ss' has incomplete type and cannot be defined
12:23: error: invalid type argument of unary '*' (have 'int')
14:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]