Search:

Type: Posts; User: jimblumberg

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds.

  1. Do you realize that std::string.c_str(), returns...

    Do you realize that std::string.c_str(), returns a const C-string, which means that you can't modify that C-string?
  2. Replies
    5
    Views
    174

    Start by doing some research. Use your favourite...

    Start by doing some research. Use your favourite search engine, searching for something like "c string comparison" should give you a good start,

    By the way I'd judge about a 2 maybe 3.
  3. Thread: Struct.

    by jimblumberg
    Replies
    11
    Views
    170

    You need to show some actual effort, no one here...

    You need to show some actual effort, no one here is going to just give you the solution.


    Break the problem down to manageable chunks, don't try to solve the entire program in one go. I'd start...
  4. Thread: Struct.

    by jimblumberg
    Replies
    11
    Views
    170

    Why not? Explain yourself, your question really...

    Why not? Explain yourself, your question really doesn't make much sense. If you want more coherent answers you need to provide more coherent questions.

    Do you understand the difference between a...
  5. Thread: Struct.

    by jimblumberg
    Replies
    11
    Views
    170

    First thing I notice is that your structures...

    First thing I notice is that your structures contain no "strings" just some doubles, integers, and single character types.



    Second there are no "separators" involved in the structures, perhaps...
  6. Since sizeof is a compile time (except when...

    Since sizeof is a compile time (except when dealing with the horrible VLA) operator it really won't make much difference.
  7. Replies
    9
    Views
    459

    What did you change?

    What did you change?
  8. Replies
    9
    Views
    459

    First off why are you using the C-string...

    First off why are you using the C-string functions in the first place? Why not just use C++ strings and then directly compare the strings?

    Second I can't reproduce your results because the program...
  9. Replies
    11
    Views
    149

    What is the purpose of the program? What input...

    What is the purpose of the program?

    What input did you use that caused the program to crash?

    Why all the horrible global variables? You need to learn to pass variables to and from your...
  10. Replies
    11
    Views
    149

    Please post your current code, inside code tags.

    Please post your current code, inside code tags.
  11. Replies
    11
    Views
    149

    Do you see any if in that line? It either needs...

    Do you see any if in that line? It either needs to be a "bare" else or else if(pt[i].vp == vp). An else all by it's self has no conditions.
  12. Replies
    11
    Views
    149

    ---> else (pt[i].vp == vp) Again else...

    ---> else (pt[i].vp == vp)


    Again else statements have on conditions, the above should just be else.
  13. Replies
    11
    Views
    149

    The else statements have no conditions.

    The else statements have no conditions.
  14. Replies
    4
    Views
    151

    Well if you use the assignment operator= in an...

    Well if you use the assignment operator= in an if() statement the statement will always evaluate to true. If you use the comparison operator== it will evaluate to either true or false, depending on...
  15. Replies
    17
    Views
    369

    Okay work on one problem at a time. What...

    Okay work on one problem at a time.

    What exactly are you entering into the program, and what exactly is the expected results with that input?

    When I enter 5 5 1 I get the following output:
    ...
  16. Replies
    4
    Views
    151

    One is a comparison, the other is an assignment.

    One is a comparison, the other is an assignment.
  17. Replies
    17
    Views
    369

    So where is the complete code?

    So where is the complete code?
  18. Replies
    17
    Views
    369

    Post your modified code. And note without the...

    Post your modified code. And note without the complete program we will probably be guessing about where the problem lies because we can't see the problem.

    Did you run the program with your...
  19. If the code actually compiles (it doesn't compile...

    If the code actually compiles (it doesn't compile on my system) the crash is understandable since you're not passing what you think you are into that function.

    Don't confuse NULL with zero, in C...
  20. Replies
    9
    Views
    228

    Okay, so you're getting lucky. How long do you...

    Okay, so you're getting lucky. How long do you think you will continue to be lucky?

    From some documentation for printf() since it is referenced above:


    So notice that printf() is expecting a...
  21. Replies
    9
    Views
    228

    There are several things wrong with that...

    There are several things wrong with that function.

    First temp is a pointer to a char, not a pointer to an array of char, so it can not be a C-string and it is also not initialized.

    Second...
  22. Then just statically allocate the memory for your...

    Then just statically allocate the memory for your array and leave the dynamic allocation until you're more familiar with the language.
  23. No you have a binary file, not a text file. It...

    No you have a binary file, not a text file.

    It appears that you probably haven't allocated the memory correctly. You need to allocate memory for the number of bytes, not the number of structures....
  24. Well yourletter appears to be a single character...

    Well yourletter appears to be a single character not an array.
  25. Replies
    3
    Views
    236

    Since the code presented in that link is C++, VLA...

    Since the code presented in that link is C++, VLA are not allowed since C++ doesn't allow VLA so those snippets are badly formed and should fail to compile when using a strictly conforming compiler....
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4