Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.13 seconds.

  1. Replies
    24
    Views
    373

    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.
  2. Replies
    24
    Views
    373

    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...
  3. Replies
    4
    Views
    85

    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!
  4. Replies
    24
    Views
    373

    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,...
  5. Replies
    13
    Views
    161

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

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

    * thread closed *
  6. Thread: Scanf

    by laserlight
    Replies
    11
    Views
    229

    That means there are no extra characters after...

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

    by laserlight
    Replies
    11
    Views
    229

    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.
  8. Replies
    4
    Views
    85

    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
  9. Replies
    24
    Views
    373

    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...
  10. Replies
    13
    Views
    161

    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...
  11. Replies
    13
    Views
    161

    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]...
  12. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    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...
  13. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    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...
  14. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    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...
  15. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    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...
  16. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    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...
  17. Thread: Scanf

    by laserlight
    Replies
    11
    Views
    229

    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...
  18. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    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...
  19. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    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....
  20. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    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...
  21. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    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,...
  22. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    Yep, that's inconsistent, and furthermore it...

    Yep, that's inconsistent, and furthermore it becomes confusing: your ink functionality really provides practically nothing over printf, whereas you could have tweaked it to do easier printing that...
  23. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    If this is invalid: ink "x=" unsigned long x;...

    If this is invalid:

    ink "x=" unsigned long x;
    Why is this valid?

    ink "x=" #x;
    HyperC looks to be so inconsistent as to be unusable.

    Are you familiar with expressing grammar formally? At...
  24. Thread: HyperC

    by laserlight
    Replies
    71
    Views
    785

    You should actually make an argument supporting...

    You should actually make an argument supporting your own language's design goals rather than just quote wikipedia.
  25. Replies
    17
    Views
    311

    Doubling the % is the way to escape it.

    Doubling the % is the way to escape it.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4