Iteration of int like string (Python -> C++) | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Iteration of int like string (Python -> C++)

How to do this on C++ ? number=5342 for a in str(number): my_function(int(a))

2nd May 2020, 12:53 AM
Quarz
1 ответ
+ 1
#include <cstdlib> for (char c : itoa(number)) my_function (stoi(c));
2nd May 2020, 1:13 AM
Mustafa K.
Mustafa K. - avatar