Your first error:
Code:
temp = strcat("0", temp);
The first argument to strcat must be a writeable destination string. "0" is a literal string, and isn't writable. If you take away the assignment as said above it'll probably compile but crash when you run it.
There are a few ways around this -- you can memmove temp to temp+1 (shift all the chars right by 1) then write '0' into the first element.
Or, you could use sprintf:
Code:
sprintf(temp2, "0%s", temp);
Note I've used a different variable for the destination -- you can't guarantee that temp will be read before 0 is written to temp2. So if you use the same temp, you could end up with garbage results.
One more thing that took me a minute to figure out - if your program crashes as soon as you start it, before doing anything, it might be because of this:
Code:
char stringout[100000000] = "";
That's around about 100MB, which many systems may not let you allocate on the stack. In this case you know the length of the string and that every character will be 3 characters, plus a NULL at the end. So you can work out how much space you need and malloc it.
[edited - thought of an easier way]
If you just want all the numbers to be 3 digits long, zero padded, you can change your first sprintf to:
Code:
sprintf(temp, "%03i", numbers[i]);
That'd also turn a tab character into 009 rather than 09, which might or might not be something you care about.