In your malloc call, your allocating enough space for eight(8) ints, but you're using a character pointer. This could get messy in the future. I would pick one, int or char, and stick with it.
Type: Posts; User: jwroblewski44
In your malloc call, your allocating enough space for eight(8) ints, but you're using a character pointer. This could get messy in the future. I would pick one, int or char, and stick with it.
And I'm pretty sure your logic for conversion is wrong. In your assignment on line 16, your adding '1' to a value that hasn't been initialized yet, which is essentially garbage. Same on line 19.
...
Well first off, in your while loop inside main, you never change the value of "binNum". It will never reach NULL.
char * output[20];
Incorrect declaration. You can either declare a character pointer, or a character array with enough space for 20 ( twenty ) characters. Refer to your documentation on proper...
Instead of a character pointer, use an array.
char string[] = "11001";
Then when you want to convert the string of characters into an integer, the function your looking for is atoi().
...
Well the way you declare str and initialize it using double-quotes means that it is stored in read-only memory, and effectively is a constant that can not be manipulated. That is not the problem,...