Search:

Type: Posts; User: pantherse

Search: Search took 0.00 seconds.

  1. Replies
    7
    Views
    3,298

    I finally got around to getting this to you:...

    I finally got around to getting this to you: Keith's programming blog: C and C++ Array Intricacies It's not my best writing, so I would appreciate comments/questions.
  2. Replies
    7
    Views
    3,298

    Let me restate, that's MY usual way. This is from...

    Let me restate, that's MY usual way. This is from the malloc/calloc manpage:
    That's the reason why I prefer to use calloc() when allocating arrays. I find it clearer to read, and you don't run the...
  3. Replies
    7
    Views
    3,298

    Okay, here's the stuff to fix your code as it...

    Okay, here's the stuff to fix your code as it stands so it'll work. As for funny pointer tricks, I'll post a link at a later time.

    First, change:
    myPtr = (int*) malloc(intValue + 2); to
    myPtr...
  4. Replies
    7
    Views
    3,298

    From the way your code looks, you seem to expect...

    From the way your code looks, you seem to expect myPtr to be used as an int array. Which means, they way you allocated the memory for myPtr
    myPtr = (int*) malloc(intValue + 2); is wrong because...
Results 1 to 4 of 4