From your other post:
"main" needs to return 0
binNum needs to be freed to avoid a memory leak
binNum needs to be tested to see if decToBin failed
decToBin needs to check to see if malloc failed
output needs to be (8 * sizeof(dec)) +1 -> 8 bits per byte
output[i] = '1' or '0', it is not initialised, so += won't work
The string output needs to have a \0 put on the end of the string.
This is what you are probably after for that while loop in main
Code:
while(*(binNum+i) != '\0')
And after all that, your string is back the front (25 -> 0b10011) because the left side (msb) was calculated from the original number mod 2, where as the lsb of that number is the original number mod 2
Enjoy