Hello i'm Denis, new to programming and i have a question which i'd be verry gratefull if you help me find answer to:
ok i'll try to explain as best as possible:
What shoud do: Program that one can enter a numbers (for example "56354290") and the idea is the program to bring out the biggest number.
So it shoud break the numbers in array and the loop (i guess) thru them to find the biggest one.
My idea: make an integer array, the user enters the numbers and it loops thru them (simple as that). The problem is that when i make that integer and i put it in the "cin>>theNumber" for example, it gives me error because i have to tell it to which array number shoud the numbers input.
So how can i first break an integer to an integer array?
1: store the whole number in a integer and then somehow break it in array
2: store each digit in array..
second case was better off-course, but i coudn't find a solver to the error that it's giving me because i was typing something like that:
int inputNumber[100];
cin >> inputNumber;
and it gives me error because i am not telling it to which number in the stack to input the information. As far as i can understand the "[index]" means' to arrange them in a stack?
The index is the offset of the array element you want to get.
For the second way: It's easier if you read the number as a string and then access its character. You'll need to convert from ASCII to actual value, for that you can subtract '0'