Well, you could arrange it so that the function you use to print doesn't print any leading zeroes.
Let me try to be a little more elaborate.
Code:
#include <stdio.h>
int main ()
{
int intArray[82];
int m, n;
// m = base
// n = digits
scanf ("%d%d", &m, &n);
// makes n values in the array 0, maybe n + 1 values?
zeroIt (intArray, n);
// Detects whether the array has overflowed
while (!overflowIt (intArray, n))
{
// prints the values in the array from intArray[0...n-1]
// shouldn't matter if we start at the end or beginning of array
// skip leading zeroes
printIt (intArray, n);
putchar ('\n');
// increases the value represented by 1
// we have to pass it the base so it knows how to carry
// shouldn't matter if we start at the end or beginning of array
incIt (intArray, m);
}
return 0;
}
Of course, those functions will have to be implemented, but that is quite exactly the main function that I would use.