Search:

Type: Posts; User: john.c

Page 1 of 20 1 2 3 4

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

  1. Did you google "windows exclusive access to...

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

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

    I doubt anyone understands that. :confused:
  5. Replies
    1
    Views
    109

    "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...
  6. 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...
  7. 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...
  8. @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...
  9. 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)
    {
  10. Replies
    8
    Views
    210

    #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;
    }
  11. Replies
    8
    Views
    209

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

    by john.c
    Replies
    4
    Views
    288

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

    by john.c
    Replies
    4
    Views
    288

    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...
  14. "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...
  15. @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...
  16. 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...
  17. Why?

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

    ...
  19. 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...
  20. 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))
    ...
  21. 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",...
  22. Replies
    40
    Views
    1,074

    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...
  23. Replies
    40
    Views
    1,074

    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.
    ...
  24. Replies
    40
    Views
    1,074

    The "syntactic sugar" (mmmmmm, sugar) is reason...

    The "syntactic sugar" (mmmmmm, sugar) is reason enough to use it. Good ol' perfect-forwarding. Gotta love it.

    But is there ever a reason to use push_back instead? Should we always use...
  25. Replies
    40
    Views
    1,074

    I didn't even consider a regex. Duh! (And I used...

    I didn't even consider a regex. Duh! (And I used to use Perl quite a bit, so I love regexes.)


    My code allows whitespace on either side of the comma or integers. I assumed that to be what was...
Results 1 to 25 of 497
Page 1 of 20 1 2 3 4