static int arr[100000]; int* printNumbers(int n, int* returnSize) { int k = 1; for (int i = 0; i < n; i++) k *= 10; int i; for (i = 1; i < k; i++) arr[i - 1] = i; *returnSize = i - 1; return arr; }