Answer the question
In order to leave comments, you need to log in
How to convert int array to int?
There is an array of integers, how to get one unique from all these numbers?
int myints[] = {7, 4, 5, 3, 0};
int a;
//Хочу чтобы a = 74530;
Answer the question
In order to leave comments, you need to log in
Okay, all you need to do is think a little.
A simple option (just for int): loop from the "end" of the array, multiplying the number each time. That is, 0 * 1 + 3 * 10 + 5 * 100 + 4 * 1000 + 7 * 10000.
And if the numbers are as a string (for example, you can enter them in a loop), adding everything as a string (or transfer the number to a string and add it. But you shouldn't do this, it's just an example of the fact that there are always several ways).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question