A simple increment function may look like this (assuming the values with the lowest weight are stored at the end):
void incrementArray(int size, int *arr)
{
int i;
for (i = size - 1; i >= 0; i--)
{
if (++arr[i] < 10)
break;
arr[i] = 0;
}
}
The decrement function would be similar:
if (--arr[i] >= 0)
break;
arr[i] = 9;