Search:

Type: Posts; User: derrickn

Search: Search took 0.04 seconds.

  1. Replies
    19
    Views
    2,085

    could you post a link to an explanation of using...

    could you post a link to an explanation of using a pointer to a pointer like you're talking about
  2. Thread: math.h

    by derrickn
    Replies
    3
    Views
    1,511

    math.h

    i'm trying to use the log() function, and i've included math.h, but i still get this error on compilation:



    util.c:15: undefined reference to `log'


    someone please inform me of what i'm...
  3. Replies
    19
    Views
    2,085

    ok i figured it out. just as i thought, the...

    ok i figured it out.

    just as i thought, the problem lied within the code of the function itself (do i get a cookie?). strlen is evil! at least i'll never make that same mistake again......
  4. Replies
    19
    Views
    2,085

    well, here are the pieces used. if you can find...

    well, here are the pieces used. if you can find anything in the additional code thats relevant to solving my problem, then i apologize.




    // -------------------------- mem.c...
  5. Replies
    19
    Views
    2,085

    ok, obviously i don't believe that there is a bug...

    ok, obviously i don't believe that there is a bug in realloc(), and i never said i did - that would be just plain stupid.

    the reason there is no other relevant code is because code outside this...
  6. Replies
    19
    Views
    2,085

    quzah: i wasn't referring to the fact that it...

    quzah: i wasn't referring to the fact that it was non-NULL being the reason it was valid, i was referring to the fact that the gdb output...



    #7 0x0804cc6e in str_cat (s1=0x973f0e8 " ...
  7. Replies
    19
    Views
    2,085

    yes that works just fine. i don't understand...

    yes that works just fine.

    i don't understand how it could be what i'm passing to it? as you can see from the gdb output, both pointers passed to the function are valid, non-NULL pointers and...
  8. Replies
    19
    Views
    2,085

    first of all, thanks to both of you for...

    first of all, thanks to both of you for attempting to help me.

    to quzah: i've debugged the program and it is definitely crashing in the call to realloc. the pointer is also valid (i made sure to...
  9. Replies
    19
    Views
    2,085

    dynamic buffers

    char *str_cat(char *s1, const char *s2)
    {
    if ((s1 = (char *)realloc(s1, strlen(s1) + strlen(s2) + 1)) == NULL) {
    perror("mem.c: str_cat(): realloc()");
    return NULL;
    }

    ...
Results 1 to 9 of 9