Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.31 seconds.

  1. Replies
    14
    Views
    402

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

    Best to clarify the "necklace" with your instructor before settling on a solution.
  2. 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...
  3. Replies
    5
    Views
    377

    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...
  4. Replies
    10
    Views
    427

    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.
  5. 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...
  6. Replies
    4
    Views
    433

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

    How do you plan to implement the priority queue?

    How do you plan to implement the priority queue?
  8. 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...
  9. Replies
    4
    Views
    488

    What is the test that fails? If you were not...

    What is the test that fails?

    If you were not given the test values, then you should write your own 9 tests that try to replicate what your instructor is testing. Knowing what is the failing test...
  10. Replies
    1
    Views
    363

    Sounds good. What's your plan, what have you done...

    Sounds good. What's your plan, what have you done thus far, and what help do you need?
  11. Thread: Macro help

    by laserlight
    Replies
    3
    Views
    441

    I can't say I've ever had reason to use the...

    I can't say I've ever had reason to use the feature myself, but variadic macros were introduced in C99.
  12. Replies
    15
    Views
    984

    No, it isn't, not at all. I demonstrated bundling...

    No, it isn't, not at all. I demonstrated bundling the head and tail in a single structure as an abstraction of a singly linked list that also keeps track of its tail, since Djsarkar was originally...
  13. Replies
    7
    Views
    1,361

    But how? The code that you provided does not have...

    But how? The code that you provided does not have any static data members (or any data members at all) so "static member data can be shared across all instances" is obviously not a reason. There are...
  14. Replies
    7
    Views
    1,361

    Err... the fact that you're listing four options...

    Err... the fact that you're listing four options that are rather different is rather weird. It is almost as if this is some MCQ question for a homework assignment and you're hoping someone will just...
  15. Replies
    7
    Views
    1,361

    The static keyword here just designates the...

    The static keyword here just designates the member function as a static member function. You could just as easily use a non-member function, except that it makes sense to associate the function more...
  16. Replies
    2
    Views
    374

    If you're dealing with a linked list that has...

    If you're dealing with a linked list that has both head and tail, then I would suggest something like this:

    struct Node
    {
    int Value;
    struct Node *Next;
    };

    struct LinkedList
    {
  17. The simple answer is: no, because it is invalid...

    The simple answer is: no, because it is invalid syntax.

    There may be some edge case or whatever where this is not true, but I don't feel like researching it, especially not when it'll probably...
  18. You've been told to make use of learning material...

    You've been told to make use of learning material like introductory books that would explain these to you. Do that.

    If you want to do exploratory learning, well, that's not necessarily wrong, but...
  19. The output is obviously different. Ok, maybe not...

    The output is obviously different. Ok, maybe not that obvious, but that's because you printed so many lines when just a few critical ones would have done the job.
  20. Replies
    15
    Views
    757

    Yeah, but isn't this futile? Everyone has their...

    Yeah, but isn't this futile? Everyone has their own preferences, e.g., I feel three spaces before a trailing comment is unnecessary, but frankly, it looks alright.

    When I think of flaws, I think...
  21. Replies
    15
    Views
    757

    Yeah, refer to my edit: I realised that I misread...

    Yeah, refer to my edit: I realised that I misread the post because I was led astray by the question and sample solutions given in the linked page instead of reading your explanation carefully. No...
  22. Replies
    15
    Views
    757

    EDIT: Oh wait, I think I understand now. ...

    EDIT:
    Oh wait, I think I understand now.

    You're not talking about programming in C to improve some sample solutions that you encountered. You're talking about whether calling this command:
    ...
  23. Replies
    15
    Views
    757

    "Indent" usually means something like "place the...

    "Indent" usually means something like "place the text at some offset relative to the current margin", hence the common notion of indenting code by a certain number of spaces. What you're doing here,...
  24. Replies
    6
    Views
    1,353

    I only joined a bit later hah

    I only joined a bit later hah
  25. Replies
    4
    Views
    680

    Where did you find this example? By now you...

    Where did you find this example? By now you should know enough to figure out from context.

    Besides figuring out from context, there's another thing you can do: write a program to test your...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4