Search:

Type: Posts; User: jimblumberg

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    7
    Views
    313

    Sure there is, where did you get your...

    Sure there is, where did you get your documentation for fopen()?

    Looks like your understanding is lacking, post your code so we can see what you're doing incorrectly.
  2. c.arr.at(0).f(); // this should be D1::f, not...

    c.arr.at(0).f(); // this should be D1::f, not B::f

    Well since C has a vector<B> member it will print the "overload" for B, not D1, remember C doesn't inherit anything from B.

    Perhaps you meant...
  3. In your Disable function you are "disabling" a...

    In your Disable function you are "disabling" a weapon that is local to that function, not the weapon that is contained in any of your classes.
  4. Replies
    7
    Views
    279

    And what are you going to do with that data?

    And what are you going to do with that data?
  5. Replies
    7
    Views
    279

    No it doesn't really use cin and it shouldn't be...

    No it doesn't really use cin and it shouldn't be using a command line argument.


    No. Something more like:



    #include <fstream>
    #include <iostream>
  6. Well you said that you are required to use Turbo...

    Well you said that you are required to use Turbo Crap in school, that you're really learning C doesn't surprise me at all. Turbo Crap was released before C++ was ever standardized so most code using...
  7. Replies
    7
    Views
    279

    So do you understand this "redirection" thing...

    So do you understand this "redirection" thing that is being talked about above?


    Yes, because "redirection" means that on the command line you told the program to use a file on disk for input...
  8. Well since that code is really mostly C (other...

    Well since that code is really mostly C (other than the use of cout) I'd have to say less than 1.

    Modern C++ would be using std::vector instead of the raw arrays (or some other standard...
  9. Well the problem occurs because of the getchar()...

    Well the problem occurs because of the getchar() on line 36, and the problem is "seen" on line 55. The problem is that getchar() leaves the newline character in the input buffer, check the boards FAQ...
  10. Probably because you left a new line character in...

    Probably because you left a new line character in the input buffer inside the menu() function.
  11. Did you try it? Did it work?

    Did you try it? Did it work?
  12. Replies
    4
    Views
    165

    Well since I really have no idea what loadimage()...

    Well since I really have no idea what loadimage() actually does or how Windows does anything, I would have to say not what I meant.


    Glad it seems logical to you, but I was only talking about...
  13. Replies
    4
    Views
    165

    Well really in C++ you should strive to avoid...

    Well really in C++ you should strive to avoid pointers and arrays when possible, use reference and one of the standard containers instead.


    What makes you think that "just" passing by pointer...
  14. Thread: char*

    by jimblumberg
    Replies
    16
    Views
    973

    No, it's a pointer. It could be either a pointer...

    No, it's a pointer. It could be either a pointer to an array of char or a pointer to a single char. Without more content you can't tell which.
  15. Replies
    20
    Views
    1,064

    What book are you using to learn C? A good book...

    What book are you using to learn C? A good book would explain the various methods to pass values to and from functions much better than what can be shown in a forum.

    Do you know that there are...
  16. Replies
    24
    Views
    774

    Yes, you're trying to assign a constant char...

    Yes, you're trying to assign a constant char array (a string literal) to a non-const char pointer.

    It should be like the following:


    const char* monkey = "what are you doing?"; // Note you...
  17. Replies
    24
    Views
    774

    So who ever said C doesn't have strings? A...

    So who ever said C doesn't have strings? A general purpose language that doesn't have strings would really be very limited.

    In C a string is an array of char terminated by the end of string...
  18. Replies
    24
    Views
    774

    That's probably because Pelles C is more up to...

    That's probably because Pelles C is more up to date and has higher "default" error diagnostics.


    Truthfully I don't do Windows so neither of the above would be my choice, but of the two Pelles...
  19. Replies
    24
    Views
    774

    By the way I would recommend Pelles C over DEV-C...

    By the way I would recommend Pelles C over DEV-C as it is probably more up to date with the current standards.

    Also if the libraries you're talking about are things like conio, then you would...
  20. Replies
    24
    Views
    774

    Show what you tried? The fgets() function should...

    Show what you tried? The fgets() function should be the "replacement". However you need to insure that you array is big enough to hold both the end of string character and the end of line character...
  21. Replies
    24
    Views
    774

    By the way if you were using a modern C compiler...

    By the way if you were using a modern C compiler compiling to the current C standard you would be getting many more errors than the few you seem to be worrying about. If your going to try to learn C...
  22. Replies
    24
    Views
    774

    Okay so everything other than the first 4 or 5...

    Okay so everything other than the first 4 or 5 lines should be in another c source file, not inside that header (from the #ifndef till the #endif stay in the header).


    What do you need to know?...
  23. Replies
    24
    Views
    774

    So, why didn't you post that code as well? You do...

    So, why didn't you post that code as well? You do know that you should not have executable code inside a header file, correct?

    Why are you still using gets()? That dangerous function can never be...
  24. Replies
    24
    Views
    774

    And remember that you can't return a pointer to a...

    And remember that you can't return a pointer to a variable that is local to some function. How is "choice" defined, it's not a "const" since you're trying to get a value from the user so I question...
  25. Replies
    6
    Views
    174

    Probably, look at memset(). But with either...

    Probably, look at memset(). But with either method you must also insure that you properly terminate the array to create a string.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4