Search:

Type: Posts; User: jimblumberg

Page 1 of 20 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    5
    Views
    140

    Really? Do you know that you should treat...

    Really? Do you know that you should treat warnings as errors and fix the problems?

    By the way here is what my compiler says about your code:



    Perhaps you need to up your compiler's warning...
  2. I don't see where your code satisfies even one of...

    I don't see where your code satisfies even one of the criteria in your problem statement. Perhaps you posted the incorrect code?

    Edit:
    I also don't see how the topic title relates to either the...
  3. Replies
    6
    Views
    204

    Perhaps you posted this in the wrong sub-forum?...

    Perhaps you posted this in the wrong sub-forum? Perhaps you meant to post in the "Projects and Job Recruitment" forum?

    This is your project, you need to do the work.
  4. Replies
    15
    Views
    304

    Actually posting large programs is usually not...

    Actually posting large programs is usually not the "best", it would be better to post the smallest complete program that illustrates the problem.
  5. What compiler/IDE are you using? If you are...

    What compiler/IDE are you using?

    If you are using some version of CodeBlocks then you need to right click on the project in the Project Management folder, then select Build Options.

    I suggest...
  6. Then perhaps you need to set the compiler to use...

    Then perhaps you need to set the compiler to use the c11 standard, for a start.


    Also what about all those other problems I pointed out?

    Those printf() format issues need to be treated like...
  7. That code doesn't compile on my machine. Here is...

    That code doesn't compile on my machine. Here is what my compiler says:



    ||=== Build: Debug in chomework (compiler: gcc9-2) ===|
    //main.c|10|warning: no previous declaration for ‘removNb’...
  8. Replies
    9
    Views
    191

    That is because "%i" and "%d" are both for...

    That is because "%i" and "%d" are both for integer types, the difference being that the "%i" recognizes a leading zero as Octal.

    What version of the compiler are you using. Are you using a 32 or...
  9. Replies
    9
    Views
    191

    Most likely. As I said using the wrong specifier...

    Most likely. As I said using the wrong specifier for the type produces undefined behaviour, a very bad place to be since anything can, and usually will happen.
  10. Replies
    9
    Views
    191

    What compiler are you using? A decent properly...

    What compiler are you using?

    A decent properly configured compiler should be emitting a few warnings that need to be fixed, since using the incorrect format specifier for the type produces...
  11. That is correct. Basically you don't. If you...

    That is correct.


    Basically you don't. If you want to get multiple values from sscanf() you need to do it by adding specifiers and variables to place the information into.

    sscanf("%d%d",...
  12. Also posted here...

    Also posted here.
  13. Replies
    10
    Views
    349

    What do you think &z[i] is really doing? Hint...

    What do you think &z[i] is really doing? Hint it's not copying an array element from one array into another array.
  14. Actually this would probably be better: ...

    Actually this would probably be better:


    for(count = 3 ; count > 0 ; --count)
    // Or even better, just define the variable in the loop it's self.
    for(for int count = 3 ; count > 0 ; --count)

    ...
  15. Yes, and as presently coded it will do this...

    Yes, and as presently coded it will do this exactly once.
  16. Perhaps you need to "reset" count? Also this: ...

    Perhaps you need to "reset" count?

    Also this:
    printf("\nYou have had three tries and failed. The number was %ld\n", chosen); should be producing a warning. If your compiler is not warning you...
  17. Replies
    10
    Views
    294

    Actually this is only true if you are talking...

    Actually this is only true if you are talking about a "Hosted environment", in a non-hosted environment the startup function name, number of arguments, and function return type are all implementation...
  18. Replies
    10
    Views
    294

    The problem is that void tom() is a function...

    The problem is that void tom() is a function declaration not a cast.

    A good properly configured compiler would be at least warning you about the issues, and probably even emitting an error or two.
  19. Replies
    4
    Views
    186

    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.
  20. Replies
    4
    Views
    186

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

    Other than the memory leaks, what don't you understand?
  21. 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...
  22. 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...
  23. You first need to assign memory to that pointer,...

    You first need to assign memory to that pointer, malloc() perhaps?
  24. 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...
  25. Thread: 3-D arrays

    by jimblumberg
    Replies
    5
    Views
    159

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