Search:

Type: Posts; User: GReaper

Page 1 of 20 1 2 3 4

Search: Search took 0.05 seconds.

  1. Replies
    11
    Views
    3,052

    Ok, first of all, you need to learn how to use...

    Ok, first of all, you need to learn how to use the debugger. It's an essential skill for all programmers.
    A Quickstart Guide to Debugging C Programs with gdb

    If you're using an IDE, it may be as...
  2. Replies
    4
    Views
    4,434

    The outer loop seems useless. Seeing that the...

    The outer loop seems useless. Seeing that the inner loop is some kind of busy loop that waits for the value of m_finished to change, and judging by the name WAIT_FOR_PERIPH, I'd say this snippet...
  3. Replies
    2
    Views
    4,019

    Indeed, using the equality operator on two arrays...

    Indeed, using the equality operator on two arrays is perfectly valid C, although it would only produce the desired result if those two arrays were actually the exact same array in memory. That...
  4. Replies
    7
    Views
    5,363

    Why are you saving the integer inside the char...

    Why are you saving the integer inside the char array? Why are you passing "sizeof(char*)" as the size?

    Btw, you don't want to use "char" for the types of size and left/right. "int" would be much...
  5. What do you need help with exactly?

    What do you need help with exactly?
  6. Initializing an array of structs is similar to a...

    Initializing an array of structs is similar to a multi-dimensional array:


    lessons info[10] = {
    { "Physical education", "Harry", "Pleter", 32 },
    { "History", "Emily", "Shelton", 12 },
    ...
  7. Replies
    3
    Views
    3,876

    They way I do it is to have two variables, one...

    They way I do it is to have two variables, one for the allocated size and another for the used size. When the used size equals the allocated size, it's time to allocate new memory.
  8. Use fgetc() and fputc() instead. Or better yet,...

    Use fgetc() and fputc() instead. Or better yet, at a lower level, use fread() and fwrite() with the buffer.
  9. Replies
    5
    Views
    5,873

    If you don't worry about punctuation, reading...

    If you don't worry about punctuation, reading words is just:

    scanf("%s", wordStr);

    For the reversing of each word, an easy implementation would be to use recursion. Or you could implement your...
  10. Replies
    7
    Views
    8,835

    Do you have any proper documentation for the...

    Do you have any proper documentation for the language and the compiler? I'm sorry, but that link is awful. You can't expect us to understand how it works just by showing some random examples. A wiki...
  11. Replies
    2
    Views
    3,948

    Because "%c" is special, in the way that it...

    Because "%c" is special, in the way that it doesn't ignore whitespace. If you want it to, you need to add a space before the percent sign, like this:


    scanf(" %c", &ch);
  12. Replies
    5
    Views
    9,153

    Search for beginner's WinAPI tutorials, they'll...

    Search for beginner's WinAPI tutorials, they'll teach you the basics.
  13. It seems like a typo here, both should be like...

    It seems like a typo here, both should be like line #14. Let me explain:

    In line #10, "p" is used like an array of pointers.
    In line #14, "p" is used like a pointer to an array.
    You can't do...
  14. Replies
    3
    Views
    4,334

    Line #13 (declaration inside the for statement)...

    Line #13 (declaration inside the for statement) is C99, although all compilers support it as an extension regardless. You should be using C99 anyway, all compilers support it (if yours doesn't, don't...
  15. Replies
    3
    Views
    4,334

    You would need to associate the different strings...

    You would need to associate the different strings a user can input with the program names (and anything else, if applicable). For example:

    typedef struct {
    const char* name;
    const char*...
  16. So, you want multiple weapons to match on the...

    So, you want multiple weapons to match on the same key? You can't do that with a map, I don't think. What you need is a multimap.
  17. Works just fine for me. You're probably passing...

    Works just fine for me. You're probably passing the wrong window handle to DefWindowProc inside cif_win32_wndproc.

    In an unrelated note, since you're using the portable OpenGL, I'd suggest not...
  18. Thread: Nice Forum

    by GReaper
    Replies
    6
    Views
    11,005

    Oof... It is indeed a nice forum. When I...

    Oof...

    It is indeed a nice forum. When I joined, back in 2009, Salem, Laserlight, Phantomotap and other regular members helped me quite a bit in becoming a better programmer.
  19. Replies
    5
    Views
    8,286

    You need to point netbeans to the bin and lib...

    You need to point netbeans to the bin and lib directories of cygwin. I don't remember, but I though netbeans had an option to do that for you automatically.
  20. Thread: OpenGL

    by GReaper
    Replies
    10
    Views
    13,532

    One minor thing: You shouldn't do the...

    One minor thing: You shouldn't do the matrix-to-matrix multiplications inside the shader, unless you have direct use for those matrices. The CPU is far better suited for that task. I usually just...
  21. Replies
    4
    Views
    8,470

    What makes you think a library is faster than...

    What makes you think a library is faster than direct WinAPI calls? Whatever the library you're using, ultimately is has to make the same (and, most of the time, many more) calls to the operating...
  22. Replies
    46
    Views
    43,193

    You may want to add '\e', it's not exactly...

    You may want to add '\e', it's not exactly standard but it's widely used for ANSI escape sequences.
  23. Thread: OpenGL

    by GReaper
    Replies
    10
    Views
    13,532

    You're obviously doing something wrong at either...

    You're obviously doing something wrong at either the loading or the rendering phase. Without code, we can just guess.
  24. How does your code even compile? Because It...

    How does your code even compile? Because It shouldn't. You can't pass a 2D array to a function without telling it its dimensions. All but the leftmost dimension must be passed, like this:


    void...
  25. Replies
    9
    Views
    11,950

    I think you misunderstood the use of...

    I think you misunderstood the use of fgetpos/fsetpos. fpos_t isn't (or rather, may not be) a simple integer. The content of an fpos_t object is not meant to be read/written directly, but only to be...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4