Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    50

    Example input and associated output would be...

    Example input and associated output would be helpful.

    @Hodor, I bet it was typed on an iphone!
  2. Structure makes a good point that you can just...

    Structure makes a good point that you can just sort the entire lines as strings.


    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    #define MAX_RECORDS 200
    #define MAX_LINE 100
  3. But isn't that just alphabetical order, like the...

    But isn't that just alphabetical order, like the first version I posted uses? That version also assumes the second number (after the comma) is always 0, but that seems to be your situation. It also...
  4. What are you talking about??? @Tricica, all...

    What are you talking about???

    @Tricica, all you need to do is read all the records into an array of structs and then sort the array. Note that you have not shown a numeric sort on the numbers,...
  5. Replies
    4
    Views
    117

    That identifier doesn't appear in your...

    That identifier doesn't appear in your code.[/COLOR]
  6. Replies
    5
    Views
    136

    So putting it all together, with simplified...

    So putting it all together, with simplified names.
    Still I wonder what the point of the second level of indirection might be.


    #include <stdio.h>

    typedef int (*PF)(int);
    typedef PF const...
  7. Replies
    5
    Views
    136

    I don't get the first issue either. I don't see...

    I don't get the first issue either. I don't see what another level of pointers achieves. Can you show the code where itype is set and where it is called?

    For the second issue, the fact that the...
  8. Did you google "windows exclusive access to...

    Did you google "windows exclusive access to device"?
  9. Your problem description is unintelligible and...

    Your problem description is unintelligible and your code is illegible (and the header is missing). If you don't care, why should we?
  10. solidusMGS? More like gaseousMGS! Am I right...

    solidusMGS?
    More like gaseousMGS!
    Am I right people?!
    People???
  11. I doubt anyone understands that. :confused:

    I doubt anyone understands that. :confused:
  12. Replies
    1
    Views
    120

    "verylong" is usually called BigNum, or similar....

    "verylong" is usually called BigNum, or similar. "verylong" makes me think of a typedef for long long or some implementation-defined larger value (e.g., __int128).

    sizeof(result) is the size of a...
  13. Replies
    2
    Views
    132

    How can we possibly tell you what you did wrong...

    How can we possibly tell you what you did wrong if you show no code?
    Why does Desktop have a windows-style backslash before it instead of the *nix-style forward slash?
    What do you mean "split the...
  14. I didn't even notice he left out the * CHAR_BIT...

    I didn't even notice he left out the * CHAR_BIT too! I even had a * 8 in my little test. But presumably it should use an unsigned long long instead of size_t since size_t is not guaranteed to be...
  15. @flp, Since he wants the ceiling of the value you...

    @flp, Since he wants the ceiling of the value you should remove the -1 (although then it will overestimate an exact power of 2, but so what).
    However, it may be just as effective to simply double...
  16. I don't know what a "code comment" is, but you...

    I don't know what a "code comment" is, but you can, of course, post your code here:


    #include <stdio.h>
    #include <string.h>

    #define MEETING_ARRAY_LENGTH 5

    int main(void)
    {
  17. Replies
    8
    Views
    225

    #include int main() { unsigned...

    #include <stdio.h>

    int main() {
    unsigned char c = '\x0A'; // proper way to set to hex value
    printf("%X\n", c << 4); // print as hex integer
    return 0;
    }
  18. Replies
    8
    Views
    214

    Are ya? :) Don't tell us anything about it....

    Are ya? :)


    Don't tell us anything about it.
    Don't give a website link or anything.
    Everybody knows what VisaType is, of course.
    I use it every day!

    Anyway, it's obviously an error in the...
  19. Thread: STL problems

    by john.c
    Replies
    4
    Views
    321

    So it's including part of algorithm but not the...

    So it's including part of algorithm but not the whole thing. Interestingly it doesn't define std::minmax. It's in stl_algo.h. But that's all implementation details since we of course wouldn't...
  20. Thread: STL problems

    by john.c
    Replies
    4
    Views
    321

    Always include the proper header as specified in...

    Always include the proper header as specified in your reference (such as cppreference.com). The proper header is, and as far as I know has always been, <algorithm>. Always compile using a specific...
  21. "Glitches out" is not very informative. In...

    "Glitches out" is not very informative.

    In restock(), the first printf has no argument corresponding to the "%.2f euros".
    Also it looks like you're missing a continue in one of the switch...
  22. @Joe1709, beware of people like "Structure" who...

    @Joe1709, beware of people like "Structure" who not only don't know C very well, but don't even know how to properly use a compiler. His "code" is riddled with errors. Just ignore him. Everyone else...
  23. There were some errors in the previous (untested)...

    There were some errors in the previous (untested) code I posted. In particular some incorrect variable names and extraneous ampersands before the string variables in the fscanf. Anyway, here's...
  24. Why?

    Why?
  25. Now that I think about it, you probably just need...

    Now that I think about it, you probably just need to move that (bonkers!) else part outside the loop and make it an if.


    printf("Enter ID: ");
    scanf("%s", &search_id);

    ...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4