I need to convert an integer array of size 4 into an int. I've seen solutions for int arrays that look like {1, 2, 3, 4} turn into 1234, and I've also seen ones where an array like {10, 20, 30} would turn into 102030. However, my problem is that I'll have an array that might look like {0, 6, 88, 54} and the solutions I previously mentioned only work on arrays with ints of the same type {e.g all one digit or all two digit}.
What should I do to solve this?
My expected output from the {0, 6, 88, 54} array would be 68854.
Examples An output with zeros in the middle should keep them, i.e. {6, 0, 0, 8} would be 6008 but {0, 6, 0, 0, 8} by default would still be 6008 in int form. I need this in an int but I wouldn't mind having a string intermediate.
{0, 6, 88, 54}what is your expected result?itoaon each element of the array and then usestrcatto append each string to the output string.