Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.11 seconds; generated 43 minute(s) ago.

  1. Replies
    19
    Views
    254

    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...
  2. Replies
    19
    Views
    254

    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...
  3. Replies
    19
    Views
    254

    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...
  4. Replies
    19
    Views
    254

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

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

    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...
  6. Replies
    2
    Views
    70

    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...
  7. Replies
    12
    Views
    167

    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++.
  8. Replies
    19
    Views
    254

    strtok does not work with regular expressions....

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

    That might be an idea for a sequel to Ratatouille :D
  10. 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...
  11. 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...
  12. 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...
  13. Replies
    1
    Views
    137

    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...
  14. 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...
  15. 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...
  16. Replies
    24
    Views
    442

    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...
  17. Replies
    25
    Views
    415

    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.
  18. Replies
    25
    Views
    415

    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.
  19. 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...
  20. Replies
    25
    Views
    415

    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.
  21. 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...
  22. Replies
    20
    Views
    334

    As I have resumed work after a two-year partial...

    As I have resumed work after a two-year partial break for postgraduate studies, I cannot keep track of what you've been doing, and I don't have the time to look over every single aspect of your...
  23. Replies
    20
    Views
    334

    I asked you why, not "give me another example in...

    I asked you why, not "give me another example in which you did this unnecessary thing". So nope, you don't have to do that. Not for list, not for tree.
  24. Replies
    20
    Views
    334

    Why does tree in main need to be a pointer with...

    Why does tree in main need to be a pointer with dynamic memory allocation?
  25. Replies
    20
    Views
    334

    Because it's a pointer. The pointer points to...

    Because it's a pointer. The pointer points to memory. A copy of the pointer also points to the same memory. A copy of that copy of the pointer also points to the same memory. So, if you change (or...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4