Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.37 seconds; generated 38 minute(s) ago.

  1. No, in this context "=" is not the assignment...

    No, in this context "=" is not the assignment operator. While initialisation certainly involves assignment in the computer science sense, C distinguishes between initialisation and assignment, that's...
  2. That's initialisation, not assignment. The key...

    That's initialisation, not assignment. The key here is that you have declared these variables outside of a function, so they have static storage duration (this is true even though the static keyword...
  3. Replies
    17
    Views
    5,932

    Surely you read the top voted answer to that...

    Surely you read the top voted answer to that Stack Overflow question? It rightly concludes:

    As for "excessive use": then don't use it excessively. Duh. I mean, have you seen three star C...
  4. Replies
    17
    Views
    5,932

    You are mistaken: the use of a namespace is not...

    You are mistaken: the use of a namespace is not "frowned upon because it is an extra language feature". In fact, for grouping a bunch of functions so loosely related that their group name is "util"...
  5. It looks like the error lies in code that you did...

    It looks like the error lies in code that you did not show, e.g., you may have made a mistake when calling the function.
  6. Replies
    1
    Views
    1,442

    The basic mechanism of header inclusion is the...

    The basic mechanism of header inclusion is the same, but of course we're talking about two different languages so there is a big difference.

    What you're looking at is probably just a matter of...
  7. Replies
    4
    Views
    1,370

    I have no inclination to check to be absolutely...

    I have no inclination to check to be absolutely sure, especially since my copy of C89 is like this giant text file that I may or may not still have in a backup, but I don't think C89 actually forces...
  8. Replies
    7
    Views
    1,971

    Generally, the solution is to avoid writing such...

    Generally, the solution is to avoid writing such code in the first place. The reason is that this:

    int a = 1;2;3;
    is the same as this except for formatting:

    int a = 1;
    2;
    3;
    That is, you...
  9. Replies
    4
    Views
    1,341

    Generally, when you start numbering variables...

    Generally, when you start numbering variables like that, it becomes worthwhile to ask if arrays should be used instead. If arrays are used, then a loop becomes a natural option.
  10. I'm a bit amused because one of the rhetorical...

    I'm a bit amused because one of the rhetorical questions Stroustrup asks in his answer to the FAQ Why use exceptions? is "Imagine that we did not have exceptions, how would you deal with an error...
  11. Replies
    2
    Views
    1,980

    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.
  12. Thread: Hello!

    by laserlight
    Replies
    1
    Views
    23,118

    Hello!

    Hello!
  13. 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...
  14. Replies
    3
    Views
    2,531

    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...
  15. 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...
  16. Replies
    8
    Views
    3,057

    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.
  17. 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...
  18. 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...
  19. 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...
  20. 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...
  21. Replies
    13
    Views
    6,641

    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...
  22. Replies
    13
    Views
    6,641

    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...
  23. Poll: * looks at votes * The tribe has spoken.

    * looks at votes *

    The tribe has spoken.
  24. Replies
    8
    Views
    4,308

    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...
  25. 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...
Results 1 to 25 of 495
Page 1 of 20 1 2 3 4