Search:

Type: Posts; User: jimblumberg

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    4
    Views
    108

    What exactly don't you understand? You create a...

    What exactly don't you understand? You create a "new" node, add some data to that "new" node then return the pointer to that "new" node, overwriting the previous pointer creating a memory leak.
  2. Replies
    4
    Views
    108

    Other than the memory leaks, what don't you...

    Other than the memory leaks, what don't you understand?
  3. Actually it is a pointer to a type product. You...

    Actually it is a pointer to a type product. You use the struct keyword to create a User Defined Type.


    It points to the location where that "product" resides in memory. The memory was allocated...
  4. What exactly don't you understand? No...

    What exactly don't you understand?


    No account is a pointer to a struct Name, Name has two data members, account_number (an int), and balance (a float).

    Do you know the difference between...
  5. You first need to assign memory to that pointer,...

    You first need to assign memory to that pointer, malloc() perhaps?
  6. Actually account is a pointer to a variable of...

    Actually account is a pointer to a variable of type Name that is uninitialized (no memory associated to that pointer) so both of those lines produce undefined behaviour.

    Is there a reason you're...
  7. Thread: 3-D arrays

    by jimblumberg
    Replies
    5
    Views
    128

    I really don't think the array will really do...

    I really don't think the array will really do what you want in the case given. And your sample array doesn't really match the data given.

    For example how do you know that the 5 students in the...
  8. Replies
    11
    Views
    362

    Check for missing semicolons in your code. ...

    Check for missing semicolons in your code.

    Also with most IDEs you should be using a project to compile your code.
  9. Replies
    15
    Views
    340

    What exactly are you expecting to print with the...

    What exactly are you expecting to print with the unsigned char 133?

    What operating system are you using, what compiler?

    If on Windows, what code page are you using?
  10. The difference is that one, Turbo C++, is so...

    The difference is that one, Turbo C++, is so outdated that it doesn't work properly on modern Windows. The other is up to date and is quite easy to install and use.



    Well first off Turbo C++ is...
  11. Replies
    2
    Views
    116

    After a quick glance, look at this snippet: ...

    After a quick glance, look at this snippet:




    for (;; // forever loop /////////// Missing a closing parentheses.
    {
    printf("Is patient a child age 0 to 11...
  12. Replies
    5
    Views
    208

    Be careful with that, if there is no newline...

    Be careful with that, if there is no newline character in the input buffer that "clear" routine will hang, waiting for the newline.


    Have you considered just starting over?
  13. Replies
    5
    Views
    208

    Be careful when mixing scanf() with fgets(), the...

    Be careful when mixing scanf() with fgets(), the scanf() function leaves the end of line character in the input buffer which fgets() will take as the end of it's input.
  14. Replies
    4
    Views
    186

    Static linking one library would not prevent...

    Static linking one library would not prevent other DLL being included. But the static linking removes the need for that particular DLL.

    Do you understand that a statically linked library can...
  15. Well since Code Blocks is just an IDE, it would...

    Well since Code Blocks is just an IDE, it would suggest that you must be doing something wrong.

    Perhaps you might want to consider using Code Blocks auto indent feature to give you some hints...
  16. Replies
    1
    Views
    99

    First do you realize that you could do this...

    First do you realize that you could do this without the array?

    Second do you realize that you're using the variable i before it is assigned an actual valid value? It has the value of zero when...
  17. It would be helpful to see some of the actual...

    It would be helpful to see some of the actual commands allowed.

    Also is it guaranteed that the "messages" will always be in upper case?

    You may want to simplify your if statement chain. It...
  18. Thread: strcmp

    by jimblumberg
    Replies
    4
    Views
    243

    No the problem is that scanf() requires two...

    No the problem is that scanf() requires two entries, are you entering two strings?
  19. Thread: strcmp

    by jimblumberg
    Replies
    4
    Views
    243

    Yes your scanf() requires two entries and it will...

    Yes your scanf() requires two entries and it will wait until you enter both entries.

    Instead of using strcmp() perhaps you should try strlen() to check the length of the string.
  20. Replies
    23
    Views
    630

    You may want to consider creating the copy...

    You may want to consider creating the copy constructor and the assignment operator overrides, m1(0, 0) = m2(0, 0); probably requires the assignment operator.
  21. Have you tried your favourite search engine? "c...

    Have you tried your favourite search engine? "c definition versus declaration" produces over 130,000,000 results, surely at least one of those links would answer your question.
  22. Replies
    4
    Views
    164

    So do you know how to do the first part (prompt...

    So do you know how to do the first part (prompt the user)?

    What about the second part (return a value)?

    You really should also start looking for a better book. Your current book is probably...
  23. Thread: EXE file

    by jimblumberg
    Replies
    11
    Views
    515

    I'm not talking about that error message. I'm...

    I'm not talking about that error message. I'm talking about the compiler error messages in your IDE, not the "runtime" message.

    For example the code you supplied gives the following errors in my...
  24. Thread: EXE file

    by jimblumberg
    Replies
    11
    Views
    515

    Probably because the build failed. Cut and...

    Probably because the build failed.

    Cut and paste the error messages from the IDE, the picture is pretty much unreadable.

    If all else fails cut and paste the complete code, inside code tags in a...
  25. Replies
    1
    Views
    210

    What do you think the values should be? Did...

    What do you think the values should be?

    Did you plug the snippet into a program and print the values?

    Are you sure that you copied the code correctly?
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4