Search:

Type: Posts; User: laserlight

Page 1 of 20 1 2 3 4

Search: Search took 0.17 seconds; generated 57 minute(s) ago.

  1. Replies
    12
    Views
    104

    You cannot implicitly convert a pointer to a...

    You cannot implicitly convert a pointer to a String to a reference to a String; that's why you need to dereference the pointer to get a String object for the String reference to refer to.


    Just...
  2. Replies
    6
    Views
    153

    I think that this is the fundamental problem: you...

    I think that this is the fundamental problem: you should make Player a polymorphic base class, defining a common interface that Knight and Cowboy can both implement, and which will be used by the...
  3. Replies
    12
    Views
    104

    If all you want to do is avoid a possible copy...

    If all you want to do is avoid a possible copy constructor call, then indeed the second example is better (if you return *string instead), but it is also so error-prone that you should live with the...
  4. Replies
    6
    Views
    153

    A few stylistic issues to address: [list] You...

    A few stylistic issues to address:
    [list]
    You didn't provide the code that shows what are the types involved, but I'm going to guess that CowboyPtr and WeaponPtr are just typedefs for Cowboy* and...
  5. I think when the requirements ask for you to pass...

    I think when the requirements ask for you to pass multiple time structs, they mean multiple objects (or pointers thereof) of the same time struct type, not three time struct types that are identical...
  6. Replies
    4
    Views
    534

    C11 only specifies these encoding prefixes for...

    C11 only specifies these encoding prefixes for string literals: u8, u, U, L. Hence, your b# and B# encoding prefixes would not conflict as a language extension.

    The syntax specified by the...
  7. Thread: Slow forum?

    by laserlight
    Replies
    11
    Views
    472

    Seems to be working for now.

    Seems to be working for now.
  8. What do you think is the problem and what have...

    What do you think is the problem and what have you tried for debugging, e.g., have you stepped through the loop with a debugger?
  9. That's because the smallest number is indeed 0....

    That's because the smallest number is indeed 0. Notice that you declared the array as having 8 int values, then initialised it with 7 int literals. Therefore, the remaining element in the array is 0,...
  10. Replies
    13
    Views
    211

    You probably want to print element instead of...

    You probably want to print element instead of vector.

    Btw, instead of just saying "it does not compile", post the compile error.
  11. Replies
    13
    Views
    211

    You should be aware that as there is increasing...

    You should be aware that as there is increasing support for templates and declaring stuff to be inline, it has also become more common for libraries (and hence C++ programs in general) to become...
  12. Replies
    13
    Views
    211

    Place it in a header that is included by the...

    Place it in a header that is included by the other headers; remember to use inclusion guards.
  13. Replies
    1
    Views
    118

    I'd start by indenting your code consistently:...

    I'd start by indenting your code consistently: every time control enters the body of a function, if statement, loop, indent by one level. Every it exits the body of that construct, decrease the...
  14. Replies
    5
    Views
    319

    No, that was not what you were trying to do. If...

    No, that was not what you were trying to do. If it was, then mysql_real_escape_string would be wrong because it escapes strings for use as string values in an SQL statement. It doesn't escape values...
  15. Another possibility is that you have already...

    Another possibility is that you have already written the program but couldn't get it to compile on the MinGW port of g++. Is this the case, and if so, what did you try and what errors did you...
  16. Replies
    5
    Views
    319

    christop's advice is sound, though there is a...

    christop's advice is sound, though there is a general case where you would have to manually sanitise certain values: when those values are used as quoted identifiers (and hence cannot be bound to...
  17. Replies
    26
    Views
    322

    I use Linux, so I cannot see what the output is...

    I use Linux, so I cannot see what the output is on screen because I cannot compile a non-standard program that uses gotoxy. That's another reason why providing a test program with test input and...
  18. Replies
    26
    Views
    322

    Actually, you can just modify my code from post...

    Actually, you can just modify my code from post #23, and you may want to change the test input too. I'm not going to do that for you because I'm not keen to venture a guess as to how you're working...
  19. Replies
    26
    Views
    322

    If you do want to insist that I'm wrong, then do...

    If you do want to insist that I'm wrong, then do the same thing: come up with the smallest and simplest compilable program that demonstrates the problem you described in post #1. Provide the test...
  20. Replies
    26
    Views
    322

    Insulting a member for genuinely providing...

    Insulting a member for genuinely providing analysis is despicable. I'm not covering up anything. You can see for yourself that my code example does indeed produce the output you described. Removing...
  21. Replies
    26
    Views
    322

    It might be easier if we looked at code. Here's a...

    It might be easier if we looked at code. Here's a test data5.txt:

    This is
    a
    test
    for
    new lines

    Here's your code from post #1 placed within a self-contained program:
  22. Replies
    26
    Views
    322

    Yes, I had a good look at your implementation of...

    Yes, I had a good look at your implementation of your algorithm as posted in post #1. How do I have it wrong?

    Notice that you never explained what exactly it is that you're trying to do. You only...
  23. Replies
    26
    Views
    322

    The bug was due to a newline that you didn't...

    The bug was due to a newline that you didn't account for. It wasn't due to your algorithm: if you correctly removed the newline while retaining the overall original algorithm, the bug would have been...
  24. Replies
    26
    Views
    322

    That's good, but that also means we have no way...

    That's good, but that also means we have no way of verifying what you did to try and remove the newlines.


    That's targeted specifically to your comment that "The dangle issue in C seems a bigger...
  25. I'd start by changing this: typedef struct{ ...

    I'd start by changing this:

    typedef struct{
    int prod_no;
    char prod_name[30];
    char prod_brand[30];
    int quantity;
    float price;
    full_date date_added;
    }inventory;
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4