Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.19 seconds.

  1. Replies
    2
    Views
    605

    You're looking at the terminal tab, so it has...

    You're looking at the terminal tab, so it has more than just your output. You could try switching to the output tab instead, or add a \n to the end of your hello world output to make it clearer.
  2. Thread: Hello!

    by laserlight
    Replies
    2
    Views
    15,773

    Hello!

    Hello!
  3. The idea is to invoke the base class constructor...

    The idea is to invoke the base class constructor that takes a HINSTANCE, passing hInstance as the argument. If you didn't do that, then the default constructor for the base class would be invoked...
  4. Replies
    3
    Views
    506

    sizeof won't do what you want since commands is a...

    sizeof won't do what you want since commands is a type rather than some kind of aggregate. Since you're explicitly assigning a value in the middle, you cannot use the trick of computing from the...
  5. The easy guess is that you're writing to...

    The easy guess is that you're writing to airfoil_d out of bounds, and airfoil_d happens to be adjacent to blade_d in memory such that this results in overwriting elements of blade_d.

    The general...
  6. Replies
    8
    Views
    972

    You need to compile as C++20, or if your compiler...

    You need to compile as C++20, or if your compiler does not support C++20, then you need to upgrade compiler.
  7. Notice that you call gridStr(str) rather than...

    Notice that you call gridStr(str) rather than gridStr(str, key). You should compile at a higher warning level so your compiler will warn you about such mistakes.

    When you compile at a higher...
  8. Suppose that s[i] == '\0'. Then, you want to move...

    Suppose that s[i] == '\0'. Then, you want to move on to the next loop, and start writing at index i as you want to overwrite the null character since you will append a null character at the end of...
  9. Having said that, I realised that you wrote "not...

    Having said that, I realised that you wrote "not all the boxes are mandatory". Does this mean that all the root box names are known in advance? If so, then maybe you're overthinking it: a struct of...
  10. Basically, you want to map root box names to...

    Basically, you want to map root box names to struct objects. As per the hint from Perl's hash variables, one way is to hash these names as strings so that they become indices in some kind of hash...
  11. Replies
    13
    Views
    2,592

    I suggest that you learn to use the standard...

    I suggest that you learn to use the standard library and perhaps other common utility libraries before you go along the path of the obscure. After you learn to use them, learn to implement them.

    I...
  12. Replies
    13
    Views
    2,592

    It sounds like you just want to do something like...

    It sounds like you just want to do something like what strcmp does to produce a yes/no result concerning the question of whether the strings are equal. If so, then it could be as simple as:

    const...
  13. Poll: * looks at votes * The tribe has spoken.

    * looks at votes *

    The tribe has spoken.
  14. Replies
    8
    Views
    1,298

    Your strategy of using char and character...

    Your strategy of using char and character constants in a switch should be absolutely portable for any standard conforming C implementation since the C standard explicitly mandates that those...
  15. The key is to understand why do we return a...

    The key is to understand why do we return a pointer from the ADD function in the first place. The answer to that is that we want to update the head pointer from the caller, and we cannot do that...
  16. Thread: DFS in C

    by laserlight
    Replies
    2
    Views
    2,162

    Perhaps it would be easier if you provided your...

    Perhaps it would be easier if you provided your implementation of the recursive approach too, as well as your test input data that demonstrates the different result.
  17. Replies
    8
    Views
    1,563

    Since you're using MinGW, the issue here might be...

    Since you're using MinGW, the issue here might be that the Visual C runtime is used, or something like that. It is why instead of the standard %lld you may have to use %I64d or something like that to...
  18. Replies
    4
    Views
    877

    The typical approach is to provide an opaque...

    The typical approach is to provide an opaque pointer. But this means that all the functions that make up the interface of your library must either accept a pointer parameter or return a pointer that...
  19. Yes. Yes Yes, but that's a...

    Yes.


    Yes


    Yes, but that's a self-referential tautology and hence doesn't really mean anything useful. What you probably meant to say is that you think that the next pointer of the first node...
  20. The OP wrote it right there in post #1: This...

    The OP wrote it right there in post #1:

    This is typically used when you want to have a constant time append operation for the linked list (in addition to constant time prepend).
  21. Yes. Yes. I think you're talking about...

    Yes.


    Yes.


    I think you're talking about the next pointer of the first node. Since the first node was only just created, there is no second node, hence the next pointer of the first node must...
  22. Replies
    6
    Views
    794

    spvar is a pointer to struct point. Therefore,...

    spvar is a pointer to struct point. Therefore, *spvar is a struct point. So what you're doing here:

    printf( "%d ", *spvar );
    is trying to print a struct point object as if it were an integer. It...
  23. Replies
    6
    Views
    794

    Unfortunately, you cannot assign to an array...

    Unfortunately, you cannot assign to an array itself. However, you can initialise them, and in this case it means initialising the struct of which the array is a member:

    struct point svar = {1, 2,...
  24. Thread: typedef

    by laserlight
    Replies
    7
    Views
    1,682

    Yeah, I hold that opinion too, as my objection to...

    Yeah, I hold that opinion too, as my objection to object pointer typedefs has to do with pointer notation such as dereferencing the pointer then becoming surprising. For opaque pointers, neither any...
  25. Replies
    10
    Views
    1,194

    Unfortunately, since new does not necessarily...

    Unfortunately, since new does not necessarily have a size of sizeof(struct point) bytes unless you've checked its declaration to confirm, it isn't as self-documenting as using sizeof(*new), in which...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4