Search:

Type: Posts; User: cerr

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    10,769

    Exaactly, I didn't take into account that [] is...

    Exaactly, I didn't take into account that [] is basically already dereferencing the actual value and hence i "only" need to dereference the list. Is that correct...Oh man, that's confusing ;) ...
  2. Replies
    14
    Views
    10,769

    Actually, I have another problem there, let's say...

    Actually, I have another problem there, let's say that there's more than 1 file in this directory.
    Code snippet:

    (*filelist) = temp;
    printf("DEBUG: filename:%s,...
  3. Replies
    14
    Views
    10,769

    Nevertheless I changed it to (*filelist[items])...

    Nevertheless I changed it to
    (*filelist[items]) = malloc(strlen(filename)+1); :)
  4. Replies
    14
    Views
    10,769

    What's the advantage of using malloc instead of...

    What's the advantage of using malloc instead of calloc then?
  5. Replies
    14
    Views
    10,769

    Yes, this actually worked out nicely, thank you!...

    Yes, this actually worked out nicely, thank you! :)
  6. Replies
    14
    Views
    10,769

    I made a printf("DEBUG:...

    I made a printf("DEBUG: realloc:%dBytes\n",(items+1) * sizeof(*temp)); right after the realloc and it prints: DEBUG: realloc:4Bytes which sounds pretty good to me, no?

    Huh but I pass the function...
  7. Replies
    14
    Views
    10,769

    Well, I have declared char **list=NULL; in my...

    Well, I have declared char **list=NULL; in my caller function and i do a
    temp = realloc(filelist, (items+1) * sizeof(*temp));
    if (temp == NULL) {
    while (--items >= 0)
    ...
  8. Replies
    14
    Views
    10,769

    Seg fault when accessing double pointer

    Hello There,

    I wrote a function that reads out all the files in a certain directory and it's writing them into an array of character arrays that was passed. The function looks like this:

    int...
Results 1 to 8 of 8