Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. I don't use Windows but maybe you need to...

    I don't use Windows but maybe you need to GlobalFree(hData) before the function returns. And you don't need the double pointer.
    Untested:


    #include <windows.h>
    #include <stdio.h>
    #include...
  2. Replies
    4
    Views
    351

    Think again.

    Think again.
  3. Replies
    1
    Views
    253

    You aren't calling the function, just...

    You aren't calling the function, just "mentioning" the function name, which does nothing.


    #include <stdio.h>

    void foo()
    {
    printf("X\n");
    }
  4. Replies
    4
    Views
    351

    I don't know the problem, but I think it's better...

    I don't know the problem, but I think it's better written like this:


    #include <avr/io.h>
    #include <util/delay.h>

    int main()
    {
    while (1)
    {
  5. Replies
    1
    Views
    190

    wordCountChoice should be an integer, not a char*...

    wordCountChoice should be an integer, not a char* if that's what it is.
    You can convert the string input to an integer with atoi().
    Also note that line 2 above does nothing.
  6. Replies
    9
    Views
    371

    I looked at the generated assembly (with -S) and...

    I looked at the generated assembly (with -S) and it has unrolled the loop, but only for 3 iterations. However, just using -funroll-loops doesn't cause the problem.
  7. Replies
    9
    Views
    371

    -Og enables optimizations that do not interfere...

    -Og enables optimizations that do not interfere with debugging.
    It would not include unrolling loops, which is at least part of what's happening here, albeit incorrectly.
  8. Replies
    9
    Views
    371

    Very strange. You can even start c at 1000....

    Very strange. You can even start c at 1000. Interesting how changing unsigned to int fixes it.


    #include <stdio.h>

    int main()
    {
    unsigned a, b, c = 1000;

    for (a = 0; a < 5; ++a)
  9. The point is that you didn't mention the other...

    The point is that you didn't mention the other post in your question. Someone might have wasted their time helping you when you had already received an answer at the other site.

    BTW, it seems that...
  10. Replies
    17
    Views
    1,301

    That's idiotic. You should crank it up at least...

    That's idiotic. You should crank it up at least as high as -Wall -Wextra -Wpedantic. In fact you can add more, such as -Wshadow to detect shadowing a variable, a common beginner mistake (although...
  11. Don't try to debug the windows header files!...

    Don't try to debug the windows header files!
    Presumably you forgot to include <windows.h> or something.
    If GUID is defined, then the definitions you are missing are:


    typedef GUID IID;
    typedef...
  12. Thread: Unions...

    by john.c
    Replies
    8
    Views
    953

    If that's true then why did you show something...

    If that's true then why did you show something different?
  13. Replies
    37
    Views
    2,159

    I doubt that very much. You are clearly a...

    I doubt that very much. You are clearly a braindead moron. :cool:
  14. x is supposed to be an integer, and presumably...

    x is supposed to be an integer, and presumably positive even though it doesn't specify.
  15. What are you babbling about? Don't tell people...

    What are you babbling about? Don't tell people what they can and can't do. You're just a guest here.

    (BTW, the "Reply With Quote" button worked this time, but it sometimes doesn't.)
  16. It seems well-defined to me, although (x - (x -...

    It seems well-defined to me, although (x - (x - 1)) is a strange way to write 1. And the answer for x=5 is not 13.333334 but 13.3333333... (so no possibility of rounding up to a 4, really).

    This...
  17. Replies
    11
    Views
    822

    This sounds totally idiotic. You really don't...

    This sounds totally idiotic.
    You really don't seem to know what you're talking about (and I know assembly quite well).
    Forget I said anything.
  18. Replies
    11
    Views
    822

    Maybe you meant something more like this. ...

    Maybe you meant something more like this.


    #include <ctype.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <time.h>

    int main() {
  19. Replies
    3
    Views
    727

    It can't be written as nested loops without...

    It can't be written as nested loops without totally changing what it does.
    It is by nature a single-dimensional loop.
    Why do you think you want a double loop?
  20. Replies
    9
    Views
    872

    WTF? I didn't realize you had a learning...

    WTF?
    I didn't realize you had a learning disability.
  21. Replies
    9
    Views
    872

    Nope. A "global" is a variable that is accessible...

    Nope. A "global" is a variable that is accessible throughout the program, in all translation units. Although a global never gets "destroyed" until the program ends (when else would it possibly be...
  22. Replies
    15
    Views
    1,205

    What a moron.

    What a moron.
  23. Replies
    15
    Views
    1,205

    Your quest is pointless. You are an idiot....

    Your quest is pointless.
    You are an idiot.
    Those are the facts.
  24. Replies
    15
    Views
    1,205

    This is pointless.

    This is pointless.
  25. Replies
    4
    Views
    575

    The problem is that you make wrapLibraryFunc...

    The problem is that you make wrapLibraryFunc static in the header file.
    This causes it to not be seen outside of it's translation unit.
    Get rid of the static.
    Also, your char* parameters should...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4