CONVERT INTEGER ARRAY INTO AN INTEGER

Hi,
I want some way so that I can convert an integer array like

int a[2] = {1,2};

to an integer
(k = 12;)

I got this function "atoi" when I googled it but this function only converts the character array to integer, like, the function which can convert the array 'a' to variable 'k'.

Simple decimal arithmetic.

Why so shouty?

int number = 0;
for (int i=0; i< length(array); i++) number *= 10 + array[i];