Search:

Type: Posts; User: ghoul

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    507

    It sounds like the libpng API should be what...

    It sounds like the libpng API should be what you're interested in. Am I wrong?
  2. Replies
    13
    Views
    542

    Just ask right here...

    Just ask right here...
  3. Replies
    8
    Views
    598

    Since you are only concerned with object files,...

    Since you are only concerned with object files, not using a library would be okay too but the library would come in handy when you have a large number of file types to detect.
  4. Replies
    8
    Views
    598

    My resumption is that you are on Linux where you...

    My resumption is that you are on Linux where you can use libmagic.
  5. Replies
    3
    Views
    329

    The warning has no implications on your side. To...

    The warning has no implications on your side. To get around it you can cast your string to const char *
    if (strcmp((const char *)text.value, "xterm") != 0)

    By the way should that be:

    ...
  6. Thread: Macro help

    by ghoul
    Replies
    3
    Views
    468

    Thanks, the term variadic saved me there. It...

    Thanks, the term variadic saved me there. It seems like they work with -std=gcc89? Is that ten years before C99? Well.



    Thanks a lot. This time, for me, it is actually not necessary because...
  7. Thread: Macro help

    by ghoul
    Replies
    3
    Views
    468

    Macro help

    Hello,

    My macro looks like this:




    #include <stdio.h>
    #include <stdbool.h>
  8. Replies
    3
    Views
    617

    Thanks for your input. Good question

    Thanks for your input.



    Good question
  9. Replies
    3
    Views
    617

    Determine the type of a struct at runtime

    Hello,

    My data is coming in the form of a pointer to void. My aim is to dump the data to stderr in a structured way. The data pointed to by the struct is a struct that could be of several types....
  10. That sounds like a decent strategy to me. ...

    That sounds like a decent strategy to me.

    Some would say it is hacky but away from the scholary world, no-one cares for code for as long it implements functionality, patterns etc as expected.
  11. There is a chance that my familiarity with this...

    There is a chance that my familiarity with this subject does not qualify me to comment on this but.

    C++ code implementing certain patterns compared to C code implementing the same pattern or even...
  12. Replies
    15
    Views
    1,036

    It is as easy as it sounds. Make them point to...

    It is as easy as it sounds. Make them point to the same address.




    ListNode *node = malloc(sizeof(ListNode));

    List->Head = node;
    List->Tail = node;
  13. Replies
    15
    Views
    1,036

    To me it sounds much better if put like this :->...

    To me it sounds much better if put like this :-> To insert a node at a certain index in the list. That way you accomplish the overall functionality of being able to insert anywhere on the list.
  14. Replies
    15
    Views
    1,036

    That initializes the variables in 'LinkedList' to...

    That initializes the variables in 'LinkedList' to NULL. After this this, the pointer List.Head and List.Tail are both NULL.

    Kindly note the declaration declares a 'LinkedList' object on the stack...
  15. You might as well think of them as two completely...

    You might as well think of them as two completely different development languages. Like you will usually find me doing.

    o.O
  16. Replies
    4
    Views
    508

    What have you tried? Do you have any code that...

    What have you tried? Do you have any code that you can show?

    My advice would be to use getline() to read the first line then discard/no put the line into any use.



    ...
  17. Haha. Interdersting. Had to try this out. It...

    Haha. Interdersting. Had to try this out. It actually works, yes.

    It would have been great to test this out with clang but:



    Testsqrt.c:24:5: error: non-void function 'sqrt_function' should...
  18. Replies
    9
    Views
    836

    It is not immediately clear to me, at least based...

    It is not immediately clear to me, at least based on this piece of code why they are passing a double pointer and not just a pointer to the function. AFAIK, double pointers are used when working with...
  19. It looks accurate to me based on the fact that...

    It looks accurate to me based on the fact that var1 is stored in 4bytes of memory.

    0xc4159c - 0x0c41598 = 4

    Four bytes is makes sense as the size of an int.
  20. Replies
    4
    Views
    459

    What exactly is not working? It is not exactly...

    What exactly is not working? It is not exactly clear what your input and what the output from the program is from your screenshot.

    Just quickly wrote a similar code, almost identical to what you...
  21. Replies
    8
    Views
    441

    That is correct. With a continue statement...

    That is correct.

    With a continue statement you instruct the program to skip any of the code that would have been executed during the current run of the most adjacent loops.

    Basically, it...
  22. Replies
    8
    Views
    441

    Lazy low hanging fruit. Counting from 1 to 10...

    Lazy low hanging fruit.

    Counting from 1 to 10 could turn into a problem for a programmer?
  23. Replies
    5
    Views
    486

    Shouldn't the code you are trying to trying to...

    Shouldn't the code you are trying to trying to understand and make sense of be in the function below?




    /* Start the scheduler to start the tasks executing. */
    vTaskStartScheduler();
  24. Thread: Indent command

    by ghoul
    Replies
    15
    Views
    825

    It looks a bit like what Microsoft Visual Studio...

    It looks a bit like what Microsoft Visual Studio editor produces by default. Definitely okay if you ask me.

    The question was also not immediately clear to me. The 'indent' command was unknown to...
  25. Thread: Indent command

    by ghoul
    Replies
    15
    Views
    825

    Is it possible that this portion of the code...

    Is it possible that this portion of the code actually executes?




    {
    fprintf(stderr, "Unknown name. Can't decide what to do.\n");
    result = EXIT_FAILURE;
    }
Results 1 to 25 of 51
Page 1 of 3 1 2 3