Search:

Type: Posts; User: christop

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    35
    Views
    934

    Do you already have a backup of all files? If...

    Do you already have a backup of all files? If not, what will you verify them against?

    Most backup software will do some sort of file verification automatically and will let you roll back to any...
  2. Replies
    35
    Views
    934

    For checksumming a large number of files, I'd use...

    For checksumming a large number of files, I'd use existing tools. You can do this easily in Linux, but it should work under WSL just as well:



    find DIR -type f -print0 | xargs -0 -n1 -P8...
  3. Replies
    15
    Views
    509

    What do you mean by "mounted media"? Every part...

    What do you mean by "mounted media"? Every part of the file system (even the root directory) is on mounted media (except for special system directories like /proc and /sys which exist without media...
  4. Replies
    6
    Views
    585

    Unless, of course, stdout is fully buffered...

    Unless, of course, stdout is fully buffered (e.g., it doesn't point at an interactive device like a terminal).
  5. Replies
    5
    Views
    450

    Using strlen() to find the end of a string before...

    Using strlen() to find the end of a string before comparing the strings from the end is going to take just about as long as comparing two strings with strcmp().

    Also, your (Structure's) revstrcmp...
  6. Replies
    7
    Views
    762

    Reading through your threads reminds me of a...

    Reading through your threads reminds me of a project that I found where a 6502 chess program was converted to C by using 6502 emulation macros. From what I understand, the 6502 is somewhat similar to...
  7. The locking concept you are looking for is called...

    The locking concept you are looking for is called a readers-writer lock, which allows for either any number of readers or a single writer, but not both simultaneously. That's basically what...
  8. Replies
    18
    Views
    1,522

    No, because that would remove some of the...

    No, because that would remove some of the protections (e.g., type safety) that C++ provides over C. C lets you get away with more implicit type conversions than C++, and that would hamper C++'s...
  9. Replies
    2
    Views
    341

    Any macro starting with an underscore is reserved...

    Any macro starting with an underscore is reserved for the implementation, which is what defines _U_ here.

    As for why the implementation uses _U_ instead of U, imagine what would happen if an...
  10. Replies
    11
    Views
    580

    That comment looks like a copy-paste of (some...

    That comment looks like a copy-paste of (some parts of) The difference between forking and cloning a repository.
  11. Thread: Realloc limit

    by christop
    Replies
    14
    Views
    1,075

    The only systems I'm aware of are 3BSD, PalmOS,...

    The only systems I'm aware of are 3BSD, PalmOS, and Novell NetWare. Considering how old and/or esoteric these systems are (3BSD was released in 1980 (10 years before C was standardized), PalmOS was...
  12. Replies
    1
    Views
    485

    I'd go with the most straightforward solution as...

    I'd go with the most straightforward solution as it's not a terribly complicated operation:


    int number_of_slots_that_have_something_other_than_0xff(const unsigned char array[50])
    {
    int...
  13. This isn't the only problem, but fgetc() returns...

    This isn't the only problem, but fgetc() returns int (not char), so c also needs to be declared as int.
  14. Replies
    10
    Views
    1,143

    I'm not 100% sure, no. Is that considered a true...

    I'm not 100% sure, no. Is that considered a true VLA, though? I thought (perhaps mistakenly) that a VLA was only an automatic variable array whose size was determined at run time. A function...
  15. Replies
    10
    Views
    1,143

    C99 and later support this type of function...

    C99 and later support this type of function declaration:



    void how(int x, int y, int array[x][y]);


    Then you just have to pass in the two dimensions (x and y) of the array when you call it....
  16. Also, PINs (also IDs, SSNs, phone numbers, etc.)...

    Also, PINs (also IDs, SSNs, phone numbers, etc.) should not be treated as numbers, even though they are numeric. They should be strings. Your example gives a good reason: if the user enters something...
  17. Tail call optimization is not guaranteed by C, so...

    Tail call optimization is not guaranteed by C, so you are very likely running into a call stack limit as @jimblumberg pointed out.
  18. Well yes of course, but OP already decided to use...

    Well yes of course, but OP already decided to use "static" which avoids that problem altogether.
  19. Ah, I read the description as if a...

    Ah, I read the description as if a comma-separated pair of numbers was called a "word". I suppose the assignment could be intended to have actual words on the input as you described. That definitely...
  20. Can you use sscanf to split each "word" in a line...

    Can you use sscanf to split each "word" in a line into numbers?


    double a, b;
    char *word = line;
    int n, offset;
    while ((n = sscanf(word, "%lf,%lf%n", &a, &b, &offset)) == 2) {
    word +=...
  21. Only if the function is also called from an...

    Only if the function is also called from an interrupt handler. If the function isn't used by any interrupt handler (only by the main code), there's no need to disable interrupts.
  22. Replies
    19
    Views
    1,563

    Just a wild guess, but the "send() and...

    Just a wild guess, but the "send() and recv()—Talk to me, baby!" section might have something to do with sending data to (and receiving data from) an IP address.
  23. Replies
    5
    Views
    590

    This sounds like an XY problem. What would you...

    This sounds like an XY problem. What would you need a 1-bit variable for?
  24. Thread: memcmp ?

    by christop
    Replies
    6
    Views
    726

    Casting (in this case, with (const void *)) is a...

    Casting (in this case, with (const void *)) is a way to tell the compiler that you know what you're doing. You don't know what you're doing (otherwise you wouldn't be asking us for help), so remove...
  25. Replies
    3
    Views
    570

    Do "Send" and "radioID" contain null-terminated...

    Do "Send" and "radioID" contain null-terminated strings? If not, string functions (e.g., strcpy) cannot be used on them. (The initializer for "Send" suggests that it's not a string and shouldn't be...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4