Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.22 seconds.

  1. Replies
    14
    Views
    183

    Then why did you write this line of code? ...

    Then why did you write this line of code?

    sequence = Sequence ();
    If you don't know what Sequence is, then you don't know what that line of code does.


    No, you should find out, e.g., search...
  2. Replies
    14
    Views
    183

    I don't know. I don't even know what Sequence is...

    I don't know. I don't even know what Sequence is for sure other than it looks like a function because it was used with function-call syntax.

    Basically, to declare something is to describe to the...
  3. Replies
    14
    Views
    183

    What is Sequence?

    What is Sequence?
  4. Replies
    14
    Views
    183

    That's easy: #include "packet.hpp" I'm...

    That's easy: #include "packet.hpp"

    I'm assuming that you're using the common convention of ".hpp" denoting a header file, and it is the very purpose of a header file to contain declarations to be...
  5. Replies
    14
    Views
    183

    Well, then the error message makes perfect sense:...

    Well, then the error message makes perfect sense: Sequence was not declared, just as it says. You may have defined it below this code or in another file, in which case you need a forward declaration...
  6. Replies
    14
    Views
    183

    As you are probably aware, the error message does...

    As you are probably aware, the error message does not make sense. Are you copying and pasting the error message? I'm assuming that you are, but it is good to check in case you happened to change...
  7. Replies
    14
    Views
    183

    What is the exact error message and which line...

    What is the exact error message and which line does it refer to?
  8. What's stopping you from using better hardware or...

    What's stopping you from using better hardware or say, cloud computing services? What's the expected bottle neck in the code that you intend to write? (e.g., if network latency is going to dominate,...
  9. Replies
    1
    Views
    268

    This doesn't look obfuscated: the variable names...

    This doesn't look obfuscated: the variable names are perhaps a little concise, but that could be okay. The function names look like they have relevant meaning, as does the text to be printed. There...
  10. Replies
    3
    Views
    312

    Could this be some kind of precompiled header...

    Could this be some kind of precompiled header issue?
  11. Replies
    4
    Views
    339

    In that case, I suggest writing two functions....

    In that case, I suggest writing two functions. First:

    void print(const int numbers[], int size)
    This will print the first size number of numbers. Implement and test that this works, then...
  12. Replies
    4
    Views
    339

    I suggest that the function look like this: ...

    I suggest that the function look like this:

    void print_reverse(const int numbers[], int size)
    Here's why:

    print_reverse makes it clear that you're printing the numbers in reverse, not...
  13. Replies
    7
    Views
    465

    I'd say it is a good idea to use them if x or the...

    I'd say it is a good idea to use them if x or the return type of the function is bool or conceptually boolean. If they are supposed to be integers, then there might be the consideration of whether...
  14. That's not usually what "portable" means. ...

    That's not usually what "portable" means.

    Anyway, if you're saying that certain constructs can be problematic when used in C because programmers coming from other programming languages that don't...
  15. Replies
    4
    Views
    377

    So, what is your code, your test input, expected...

    So, what is your code, your test input, expected output, and actual output?
  16. Thread: FIFO Queue

    by laserlight
    Replies
    21
    Views
    943

    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...
  17. Replies
    5
    Views
    548

    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...
  18. Replies
    5
    Views
    548

    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...
  19. As conjectured in your other topic: Is this...

    As conjectured in your other topic:

    Is this true?
  20. Replies
    18
    Views
    1,468

    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...
  21. Replies
    18
    Views
    1,468

    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...
  22. Replies
    18
    Views
    1,468

    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...
  23. Replies
    18
    Views
    1,468

    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...
  24. Replies
    18
    Views
    1,468

    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.
  25. Replies
    8
    Views
    800

    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...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4