I have to get a string of numbers of 2 digits separated by spaces, take the numbers out somehow and do operations with them. But the values are all going wrong, see for yourselves:
...
string = "08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08"; //example
for (int i = 0; i < string.size()-2; i += 3){
arr[i] = 10 * string[i] + string[i+1];
cout << arr[i] <<' '<< 10 * string[i] <<' '<< string[i] << string[i+1] <<endl;
}
output:
536 480 08 i guess 0 times 10 isn't 480 as well as that plus 8 equals 536
530 480 02
550 500 22
625 570 97
566 510 38
543 490 15
528 480 00
568 520 40
528 480 00
603 550 75
532 480 04
533 480 05
535 480 07
606 550 78
580 530 52
540 490 12
578 530 50
605 550 77
619 570 91
536 480 08