Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.24 seconds.

  1. Thread: FIFO Queue

    by laserlight
    Replies
    21
    Views
    486

    The idea is to pass a pointer to a struct Queue...

    The idea is to pass a pointer to a struct Queue object to queueInit so that queueInit can supply the initial values which will then be reflected in the object from the caller. You don't have to use...
  2. Replies
    5
    Views
    223

    This looks pretty problematic: My guess is...

    This looks pretty problematic:

    My guess is that this goes back to my observation that within append you're assigning to an object that has not been constructed. You should look into the use of...
  3. Replies
    5
    Views
    223

    Well, I'd say that it is good that you're...

    Well, I'd say that it is good that you're learning how to write a generic dynamic array class template from scratch, but you might want to do some reading on how to write classes that do resource...
  4. As conjectured in your other topic: Is this...

    As conjectured in your other topic:

    Is this true?
  5. Replies
    15
    Views
    709

    The use of void to mean an empty parameter list...

    The use of void to mean an empty parameter list is valid, but unusual in C++ because it has no benefit, whereas in C it can distinguish between an empty parameter list and a declaration of a function...
  6. Replies
    15
    Views
    709

    I didn't raise an issue about aghast's code. I...

    I didn't raise an issue about aghast's code. I noted "that this is the C++ programming forum, so you can and should assume C++ by default, not C". Remember, one should use tools that are appropriate...
  7. Replies
    15
    Views
    709

    Because it would be additional effort to have to...

    Because it would be additional effort to have to phrase the explanations for and code in C while also targeting C++ (hence if you want to be sure that "it compiles and doesn't introduce problematic...
  8. Replies
    15
    Views
    709

    I think so, but I haven't checked with a C++...

    I think so, but I haven't checked with a C++ compiler. However, it is clear from the text and the style of the code that aghast felt the need to assume C while referencing C++ to answer the question...
  9. Replies
    15
    Views
    709

    aghast: note that this is the C++ programming...

    aghast: note that this is the C++ programming forum, so you can and should assume C++ by default, not C.
  10. Replies
    8
    Views
    486

    Pardon me, but I thought you wanted to port over...

    Pardon me, but I thought you wanted to port over to C, not C++.

    As for your question: maybe a possible approach in C or C++ would be to return a value, and based on this value the caller decides...
  11. Replies
    5
    Views
    446

    The *nix read and write operate on bytes, so the...

    The *nix read and write operate on bytes, so the bytes could be the bytes of the int value in memory, or they could be the bytes of a string representation of the number; it's up to you.
  12. Replies
    1
    Views
    348

    nRow is converted to unsigned int, so it becomes...

    nRow is converted to unsigned int, so it becomes the largest unsigned int value.
  13. Replies
    11
    Views
    364

    info is normally used to print some info rather...

    info is normally used to print some info rather than to actually do something though. Wouldn't it be simpler to just write say:

    all:
    $(pull_mak)

    EDIT:
    Although I guess naming the target...
  14. Replies
    11
    Views
    364

    Shouldn't lines 5 and 6 go in a rule or whatever...

    Shouldn't lines 5 and 6 go in a rule or whatever they call it?

    EDIT:
    Oh, looks like line 5 doesn't have to go in a rule, but it makes sense to keep it with line 6.
  15. Replies
    11
    Views
    364

    If I remember correctly, a common reason for that...

    If I remember correctly, a common reason for that error is the makefile being indented by spaces instead of tabs.
  16. Replies
    27
    Views
    1,305

    You don't have to use Code Blocks if you're...

    You don't have to use Code Blocks if you're having trouble getting ot installed; just use something else of your choice that's updated and works with gcc or whatever compiler you choose.
  17. Replies
    7
    Views
    733

    RCC_BASE_ADDR is a macro, so after macro...

    RCC_BASE_ADDR is a macro, so after macro replacement, it is as if you had written:

    p = (uint32_t *)(&0x40023800U);
  18. Replies
    7
    Views
    733

    They are not equivalent, so you might want to...

    They are not equivalent, so you might want to change instructor if that's what the instructor told you.

    To elaborate: the second method treats the int value as the address of an int. So pA does...
  19. I'd say no: you do have to define two in the same...

    I'd say no: you do have to define two in the same translation unit as one in order for it to be static/have internal linkage and yet called by one. A compromise solution might be to make use of a...
  20. This is wrong because you have a local variable...

    This is wrong because you have a local variable for the new local: that variable ceases to exist after the function returns. You could make it static, but then all you'll ever have is one variable,...
  21. What is a "pattern"?

    What is a "pattern"?
  22. Replies
    27
    Views
    1,081

    I don't see why that is so.

    I don't see why that is so.
  23. Replies
    27
    Views
    1,081

    That's great! If we apply what you wrote to your...

    That's great! If we apply what you wrote to your more complex problem with linked lists though, what you're doing is equivalent to doing deep copying. Granted, in this simplified version it is...
  24. Replies
    27
    Views
    1,081

    So what I am suggesting is this: attempt a...

    So what I am suggesting is this: attempt a simpler version of what you're trying to solve, and show us how you do it. Forget about linked lists for now, and focus on the notion of implementing...
  25. You're right: they match. It may make no...

    You're right: they match.

    It may make no difference, but I suggest that you remove the using declaration from the header file: fully qualify std::string there instead. In the source file, move the...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4