Search:

Type: Posts; User: draugr

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    2,711

    Yes, that should work.

    Yes, that should work.
  2. Replies
    6
    Views
    2,711

    Hei Drogin :) It's actually simple and you...

    Hei Drogin :)

    It's actually simple and you pretty much guessed it: the "magic function" is isatty(int filedes). The function can tell you if stdin (file descriptor 0) comes from an interactive...
  3. Exactly. This is easy to imagine in binary,...

    Exactly.
    This is easy to imagine in binary, rather than hexadecimal.



    res = num & mask;
    num = 01101101 (0x6d)
    mask = 11110000 (0xf0)
    ----------------
    res = 01100000 (0x60)
  4. This is easy with the bitwise operator & If...

    This is easy with the bitwise operator &

    If you have
    int x = 0xb148;
    you can extract the 'b' with a mask 0xf000
    so you'd do:
    int res = x & 0xf000;
    and now res == 0xb000

    Another example: if...
  5. Replies
    4
    Views
    1,062

    It is just a program, not a library, but I do...

    It is just a program, not a library, but I do intend to put it on my website with the code, so I'd like to use good practices and not have to be ashamed of it :). What you say sounds reasonable...
  6. Replies
    4
    Views
    1,062

    Thanks, medievalelks The different comparison...

    Thanks, medievalelks

    The different comparison methods will be written for the user, so that he can decide for himself and choose if he needs slow bit by bit comparison or if a quick size+date...
  7. Replies
    4
    Views
    1,062

    Help me design a "modular" function

    Hi again,

    A part of the functionality I'm putting into my program is comparing two files to check if they are equal. This can be done in a bunch of ways, eg. comparing bit by bit, by checksum, by...
  8. Replies
    10
    Views
    8,816

    Thanks!

    Thanks!
  9. Replies
    10
    Views
    8,816

    Where to put local auxiliary functions?

    Hi everyone,

    I've taken a C++ class this semester and now I'm writing the seminal program, which is my first large-ish C++ project.

    Usually it's a good idea to split code into smaller auxiliary...
Results 1 to 9 of 9