Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.19 seconds.

  1. Replies
    5
    Views
    290

    john.c's code stuck strictly to the C standard...

    john.c's code stuck strictly to the C standard library. This makes it more generic than the lesser known and specialised HolyC, and easily modified, e.g., I can look up stuff if I don't know and...
  2. The reason is that there's no linking involved in...

    The reason is that there's no linking involved in creating a static library, since the static library is merely an archive of object files.
  3. Replies
    17
    Views
    488

    Y'all just showing off now :D

    Y'all just showing off now :D
  4. Hello, long time no see. I'm afraid that I don't...

    Hello, long time no see. I'm afraid that I don't have a direct solution, but I'm wondering what's your use case. Like, if you're going to be doing something like this:

    A<1, 2> a;...
  5. That's because int is presumably 4 bytes and thus...

    That's because int is presumably 4 bytes and thus 32 bits on your system. The online calculator you used set it as 16 bits instead.

    That would be a general issue if you choose to go with option...
  6. The result of the address-of operator is a...

    The result of the address-of operator is a pointer. In post #4, you wrote that "The value of a pointer (p = &a) is the address of another variable", so you should already understand this.


    Yes,...
  7. Replies
    5
    Views
    367

    Well, I have always programmed for hosted...

    Well, I have always programmed for hosted implementations where there's an OS and thus the notion of casting an integer constant (other than zero) to a pointer is weird to me. But you're looking at...
  8. No, a is an array of 6 float elements. But when...

    No, a is an array of 6 float elements. But when it is passed as an argument to summate, it is converted to a pointer to its first element.
  9. The number of parameters is different, but...

    The number of parameters is different, but because you provided a default argument, both of them can be called with a single argument of the same type. Thus, it becomes ambiguous which one is...
  10. Replies
    5
    Views
    367

    It is literally just a type cast. If you expand...

    It is literally just a type cast. If you expand it, then this:

    NRF_SAADC->INTENSET = SAADC_INTENSET_END_Msk;
    becomes:

    ((NRF_SAADC_Type*)0x40007000UL)->INTENSET = SAADC_INTENSET_END_Msk;
    The...
  11. This doesn't appear in the context you provided....

    This doesn't appear in the context you provided. I'm guessing that you're asking this question in the context of your post #1, for example, you're asking what does (int *) mean in this declaration:
    ...
  12. Well, first you have to understand that this...

    Well, first you have to understand that this declares a function named summate having a parameter of type pointer to float, and with a return type of float:

    float summate(float z[]);
    Yes, you see...
  13. On one hand, you can say that this is the classic...

    On one hand, you can say that this is the classic design-by-committee issue: from what I understand, the C++ standards committee has been debating the module feature for the better part of the last...
  14. I decided to give it a go with clang 12 and ended...

    I decided to give it a go with clang 12 and ended up with:

    // main.cc
    import second;

    int main()
    {
    second_fn();
    }
  15. Replies
    5
    Views
    284

    Yes, an object name declared at file scope has...

    Yes, an object name declared at file scope has external linkage by default.
  16. It is impossible for the caller of get_next_line...

    It is impossible for the caller of get_next_line to call the equivalent of free(s) as s is never returned.


    That's exactly what I was talking about, hence I mentioned that "the very last call...
  17. In get_line, I noticed: line = ft_substr(*s,...

    In get_line, I noticed:

    line = ft_substr(*s, 0, i);
    tmp = *s;
    *s = ft_substr(tmp, i, ft_strlen(tmp) - i);
    free(tmp);
    return (line);
    ft_substr returns a string allocated by malloc. The string...
  18. Replies
    20
    Views
    1,007

    Best to clarify the "necklace" with your...

    Best to clarify the "necklace" with your instructor before settling on a solution.
  19. What probably happened is that the lambda...

    What probably happened is that the lambda function was inlined, so the end result was the same.

    john.c's swapping idea might work, but if you're doing something a bit more complex, another...
  20. Replies
    5
    Views
    599

    I'd say it's a matter of style: as n is an array,...

    I'd say it's a matter of style: as n is an array, the address resulting from implicitly converting n to a pointer and from &n is the same. Since you're coercing the type anyway, there is thus no...
  21. Replies
    10
    Views
    755

    A quick check shows that libpng is open source,...

    A quick check shows that libpng is open source, so you can always peruse the source code to find out.
  22. I am afraid that I have not yet had time to play...

    I am afraid that I have not yet had time to play around with modules, and what you described doesn't sound like how I expect them to work from what I recall reading on them. I suggest that you post a...
  23. Replies
    4
    Views
    577

    You need to read the next sentence for the...

    You need to read the next sentence for the context, i.e., Malcolm McLean is trying to address the criticism that the name "RAII" is misleading by giving it a more limited meaning and thus is able to...
  24. Replies
    13
    Views
    681

    How do you plan to implement the priority queue?

    How do you plan to implement the priority queue?
  25. Simple typo error: the word is "namespace", not...

    Simple typo error: the word is "namespace", not "nsmespace". Having said that, this using directive should be placed after the last header inclusion so as to avoid affecting the contents of the...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4