How can i change char to int and send it to massiv in c++
/* Demak, boshladim created by A.Behzod bu dastur sonni shunchaki qabul qiladi va uni massivga joylaydi fayl <<bu max ko*paytma>> uchun maxsus */ #include<iostream> #include<math.h> using namespace std; int main() { char lg[3]; cout<<endl; cin >>lg[0]>>lg[1]>>lg[2];//belgilar for(int i=0; i<10; i++) { int son[10]; //massiv //massivga son kirityapti son[i] = (int)lg[i] - 48; cout << son[i];} main(); return 0; } So there is problem that 'i' is changing 0 when code repeat main() function But i want to send to son[i] integer number from char[lg] one by one And it is important that I should press any key durinng three number sended