Search:

Type: Posts; User: jwroblewski44

Search: Search took 0.01 seconds.

  1. Replies
    25
    Views
    2,890

    In your malloc call, your allocating enough space...

    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.
  2. Replies
    25
    Views
    2,890

    And I'm pretty sure your logic for conversion is...

    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.
    ...
  3. Replies
    25
    Views
    2,890

    Well first off, in your while loop inside main,...

    Well first off, in your while loop inside main, you never change the value of "binNum". It will never reach NULL.
  4. Replies
    25
    Views
    2,890

    char * output[20]; Incorrect declaration....

    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...
  5. Replies
    25
    Views
    2,890

    Instead of a character pointer, use an array. ...

    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().

    ...
  6. Replies
    25
    Views
    2,890

    Well the way you declare str and initialize it...

    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,...
Results 1 to 6 of 6