Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.20 seconds; generated 4 minute(s) ago.

  1. You can follow such a rule, but there are cases...

    You can follow such a rule, but there are cases when there isn't much use in say, initialising a pointer to be a null pointer because you are immediately going to pass its address to a function that...
  2. You initialised it to be a null pointer, so it...

    You initialised it to be a null pointer, so it most certainly isn't pointing to anything valid, whereas if it is a non-null pointer it may or may not be pointing to something valid.
  3. Replies
    6
    Views
    218

    Well, that's what __STDC_LIB_EXT1__ is for,...

    Well, that's what __STDC_LIB_EXT1__ is for, although if you're going to check for it, perhaps you might as well just do better checking for memcpy.
  4. Replies
    21
    Views
    528

    You could use English, as long as you were...

    You could use English, as long as you were sufficiently detailed.

    My point is that when you want to parse something, you need to be absolutely clear as to its format/grammar. Unless you literally...
  5. Replies
    21
    Views
    528

    Well, that's not necessarily a problem. What you...

    Well, that's not necessarily a problem. What you haven't done is precisely define the input format. Regex is one way to do that, but of course any reasonable human-readable way to express the grammar...
  6. Replies
    21
    Views
    528

    A perfectly valid assumption for a function named...

    A perfectly valid assumption for a function named StringIsUpper. That's why you should have named it StringIsAnnouncer ;)


    I'm sorry Click_here but you are making assumptions about a criticism...
  7. Replies
    21
    Views
    528

    strtok has its place, but depending on catacombs'...

    strtok has its place, but depending on catacombs' requirements, it may be too much of a blunt instrument, e.g., maybe whitespace must be preserved. Note that your example is flawed: identifying the...
  8. Replies
    21
    Views
    528

    If you're literally testing with "SPEAKER2", that...

    If you're literally testing with "SPEAKER2", that [A-Z]+ won't match it either.
  9. Replies
    1
    Views
    169

    I know the answer to this despite having never...

    I know the answer to this despite having never programmed for the Arduino because I was able to search the Web. Alternatively, you can try it yourself when you actually have an Arduino.


    The...
  10. Replies
    2
    Views
    164

    Post the smallest and simplest compilable C...

    Post the smallest and simplest compilable C program that demonstrates the problem, along with the test Python program.

    Actually, looking at the first fprintf call I'm guessing that you're writing...
  11. Replies
    12
    Views
    259

    This is the C programming forum, so that...

    This is the C programming forum, so that statement is not true, though it is still a valid recommendation if the code is meant to be compilable as C++.
  12. Replies
    21
    Views
    528

    strtok does not work with regular expressions....

    strtok does not work with regular expressions. You may have to use a third party library.
  13. That might be an idea for a sequel to Ratatouille...

    That might be an idea for a sequel to Ratatouille :D
  14. That's why you need to give the flag a...

    That's why you need to give the flag a descriptive name: what's the flag for, what does true/false for the flag denote? Once you figure that out, it will become obvious why you need to set it...
  15. Simple tip until you're better at C++ such that...

    Simple tip until you're better at C++ such that you can ignore it and know exactly what went wrong: always use braces, even when the body of the if statement etc is only one statement. If you always...
  16. Don't name flags "flag": it only tells the reader...

    Don't name flags "flag": it only tells the reader that it is a flag without saying what the flag is for and what does a true or false value for the flag mean. Name it something like...
  17. Replies
    1
    Views
    179

    In this case it is safe because you're going from...

    In this case it is safe because you're going from something that can be modified to a const context. It is the vice versa situation that can be unsafe, e.g., because it could lead to an attempt to...
  18. You already have the answers to that in posts #3...

    You already have the answers to that in posts #3 and #4, but you can't use them. So, if you must use that method, then you have to look up what's the largest possible value of that type, set your min...
  19. Earlier, you wrote: Do that and it will solve...

    Earlier, you wrote:

    Do that and it will solve your min issue. If you wish to avoid code repetition without moving code into a function, then you could create a bool variable to determine whether...
  20. Replies
    24
    Views
    663

    It's inventive, but honestly, forget it: it's...

    It's inventive, but honestly, forget it: it's also code obfuscation, and unless you're planning to do that as a sport, by and large this is harmful.

    I will reserve final judgement until you have a...
  21. Replies
    25
    Views
    642

    My guess would be that you were tired and somehow...

    My guess would be that you were tired and somehow ended up either not saving the code, or forgetting to compile it, or sometimes you might need to do a rebuild but didn't.
  22. Replies
    25
    Views
    642

    Visual Studio Code was implemented with...

    Visual Studio Code was implemented with multi-platform functionality in mind; I don't think there is any port of Visual Studio to Linux beyond say, Wine.
  23. There is an obvious possibility: some_func is...

    There is an obvious possibility: some_func is always returning false for the input you tested. Check with a debugger to see if some_func ever does return true, or temporarily change some_func to...
  24. Replies
    25
    Views
    642

    Visual Studio Code is a heavyweight editor or a...

    Visual Studio Code is a heavyweight editor or a lightweight IDE, depending on what extensions you install. Visual Studio, on the other hand, is a heavyweight IDE. Two different tools.
  25. In main, you need two strings: one string to...

    In main, you need two strings: one string to store ths overall result and one string to store the string read from the user.

    Note that you aren't actually making use of varargs in this way: you...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4