0

I have a question.

string test;
int sum = 0;

cout << "podaj liczbe; ";
cin >> test;
cout << "dlugosc: " << test.length() << endl;
for(int i = 0; i < test.length(); i++)
{
    cout << test[ i ] << endl;
}

cout << "suma" << sum << endl;

Lets say I will put a number 234 into string, program will show me 2, 3, 4 on screen and is there any way to create int with exactly value of 234? And analogously if I put for example 555 number into string is there way to create int with 555 value?

Dmitry Kuzminov
  • 6,180
  • 6
  • 18
  • 40
babidi
  • 19
  • 5

0 Answers0