Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.12 seconds.

  1. Replies
    1
    Views
    36

    For a moment I thought this was referring to the...

    For a moment I thought this was referring to the recent events in Hong Kong or something.
  2. Thread: Nice Forum

    by laserlight
    Replies
    6
    Views
    101

    I'm as puzzled as you as to why a person with...

    I'm as puzzled as you as to why a person with over a decade of experience doesn't demonstrate a commensurate amount of skill here, but in the end this forum is only a window into a person's skill...
  3. Replies
    2
    Views
    29

    As in compile a C program?

    As in compile a C program?
  4. Replies
    5
    Views
    116

    You call the function with the initial value as...

    You call the function with the initial value as that argument.


    Of course not, unless you say, have some notion of half a decimal place or 0.34 of a decimal place.
  5. Replies
    32
    Views
    630

    Sure, but in the end it's up to you to program a...

    Sure, but in the end it's up to you to program a solution if you want to learn.
  6. Replies
    32
    Views
    630

    Which part do you find confusing? The idea is...

    Which part do you find confusing?

    The idea is to have two parallel arrays of strings such that the element at index i of one array corresponds to the element at index i of the other array, for all...
  7. Replies
    4
    Views
    89

    I doubt we debated over those: I've never done...

    I doubt we debated over those: I've never done more than dabbled a bit in them!
  8. Replies
    32
    Views
    630

    Assuming the compiler manages to identify that...

    Assuming the compiler manages to identify that the strlen call in the loop condition is effectively a loop constant, this code has a similiar time complexity to what Salem suggested in post #8,...
  9. Replies
    13
    Views
    165

    You're posting pretty much the same thing as your...

    You're posting pretty much the same thing as your other thread.

    * thread closed *
  10. Thread: Scanf

    by laserlight
    Replies
    11
    Views
    266

    That means there are no extra characters after...

    That means there are no extra characters after the integer that was parsed.
  11. Thread: Scanf

    by laserlight
    Replies
    11
    Views
    266

    The user inputs an integer (or something else) as...

    The user inputs an integer (or something else) as text. You then parse this into an int (or other integer type). So, it isn't complicated: you merely separate reading from parsing for better control.
  12. Replies
    4
    Views
    89

    It's fairly common for 9 year olds to learn to...

    It's fairly common for 9 year olds to learn to program these days, but two decades ago you were practically a prodigy :o
  13. Replies
    32
    Views
    630

    I'm not familiar with multi-character literals,...

    I'm not familiar with multi-character literals, but as you discovered they don't work for you in this instance.

    Rather, input the morse code as a string which you can then break up into...
  14. Replies
    13
    Views
    165

    So how does HyperC handle the issue? It's a...

    So how does HyperC handle the issue?

    It's a logic error. Your logic is simply wrong, so if you're not having any issues, then either you wrote HyperC to handle this somehow, or you didn't and...
  15. Replies
    13
    Views
    165

    This looks like it has an out of bounds access...

    This looks like it has an out of bounds access bug:

    // string comparison function ;
    int compare($*string1,$*string2) {
    #response = 1;
    loop 0 to strlen(string1) as i {
    case string1[i]...
  16. Thread: HyperC

    by laserlight
    Replies
    75
    Views
    871

    It isn't! You forgot to check the return...

    It isn't!


    You forgot to check the return value of fgets when providing an example in the C programming forum recently :p

    But anyway, I'm talking about rigour of language specification, not...
  17. Thread: HyperC

    by laserlight
    Replies
    75
    Views
    871

    So this means that you want HyperC to retain the...

    So this means that you want HyperC to retain the notion of undefined behaviour. This means that the responsibility is on you to define HyperC rigorously, because whatever you miss out in this regard...
  18. Thread: HyperC

    by laserlight
    Replies
    75
    Views
    871

    The Wikipedia article is a good starting point:...

    The Wikipedia article is a good starting point: undefined behaviour

    It's essential knowledge for a C programmer because it is such a source of bugs, and even more so if you're designing a language...
  19. Thread: HyperC

    by laserlight
    Replies
    75
    Views
    871

    Do you understand what "undefined behaviour"...

    Do you understand what "undefined behaviour" means in C? It's important for HyperC since you want to build HyperC on C. If you were designing HyperC from scratch instead, you might choose to ditch...
  20. Thread: HyperC

    by laserlight
    Replies
    75
    Views
    871

    You can stop misquoting me now: I wrote that in...

    You can stop misquoting me now: I wrote that in reference to your reply to me that "tbh, i can do whatever i want. I built it." when I reminded you that "calling free on an array of char results in...
  21. Thread: Scanf

    by laserlight
    Replies
    11
    Views
    266

    scanf is unlikely to be a good tool for the job...

    scanf is unlikely to be a good tool for the job here. I suggest:

    Use fgets to read a line. If the resulting string only consists of "\n", then only the enter key was pressed.
    Otherwise, use...
  22. Thread: HyperC

    by laserlight
    Replies
    75
    Views
    871

    Not saying that I'm volunteering, but one option...

    Not saying that I'm volunteering, but one option then is to team up with someone who's better at documentation. This has the added benefit of being able to talk over stuff with someone else and hence...
  23. Thread: HyperC

    by laserlight
    Replies
    75
    Views
    871

    That's an incomplete answer. Remember, if you're...

    That's an incomplete answer. Remember, if you're reading input to be stored in an array, the size of the array must be known in advance, whether it is a fixed size array or a variable length array....
  24. Thread: HyperC

    by laserlight
    Replies
    75
    Views
    871

    It looks like get implicitly declares the string,...

    It looks like get implicitly declares the string, which leads to the question: what is the type of this string? Is it an array of char, and if so, what is its size? Is it a pointer to char with...
  25. Thread: HyperC

    by laserlight
    Replies
    75
    Views
    871

    That's poor justification for limiting a feature...

    That's poor justification for limiting a feature that could have been useful.


    I want to structure my code such that I can use ink for printing unsigned long variables without a format string,...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4