could you post a link to an explanation of using a pointer to a pointer like you're talking about
Type: Posts; User: derrickn
could you post a link to an explanation of using a pointer to a pointer like you're talking about
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...
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......
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...
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...
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 " ...
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...
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...
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;
}
...