Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds; generated 24 minute(s) ago.

  1. Replies
    5
    Views
    102

    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...
  2. Replies
    5
    Views
    102

    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...
  3. Did you google "windows exclusive access to...

    Did you google "windows exclusive access to device"?
  4. 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?
  5. solidusMGS? More like gaseousMGS! Am I right...

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

    I doubt anyone understands that. :confused:
  7. Replies
    1
    Views
    110

    "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...
  8. Replies
    2
    Views
    130

    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...
  9. 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...
  10. @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...
  11. 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)
    {
  12. Replies
    8
    Views
    216

    #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;
    }
  13. Replies
    8
    Views
    210

    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...
  14. Thread: STL problems

    by john.c
    Replies
    4
    Views
    296

    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...
  15. Thread: STL problems

    by john.c
    Replies
    4
    Views
    296

    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...
  16. "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...
  17. @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...
  18. 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...
  19. Why?

    Why?
  20. 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);

    ...
  21. The code you've posted wouldn't even compile if...

    The code you've posted wouldn't even compile if it was part of a complete program (e.g., line 25). Post the smallest program you can create that demonstrates the problem. Often in creating such an...
  22. Replies
    15
    Views
    367

    #include #include #include...

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

    void trimRight(char *str) {
    char *end = str + strlen(str);
    while (end > str && isspace(*--end))
    ...
  23. Replies
    15
    Views
    367

    If you don't need it to be particularly robust...

    If you don't need it to be particularly robust and you never have commas in the first string then the simplest way is this:


    #include <stdio.h>

    int main() {
    FILE *fin = fopen("yourfile",...
  24. Replies
    40
    Views
    1,081

    blank_lines: I wouldn't say that *nix (the...

    blank_lines:
    I wouldn't say that *nix (the operating system) adds a newline at the end of a text file, although it is standard practice in *nix text editors to ensure that the last line ends in a...
  25. Replies
    40
    Views
    1,081

    1. sin >> line won't do anything since sin has...

    1. sin >> line won't do anything since sin has nothing in it, so nothing will be put into line. Maybe you meant sin << line, but that is not legal for an istringstream. You should try it out.
    ...
Results 1 to 25 of 497
Page 1 of 20 1 2 3 4