Yes, that should work.
Type: Posts; User: draugr
Yes, that should work.
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...
Exactly.
This is easy to imagine in binary, rather than hexadecimal.
res = num & mask;
num = 01101101 (0x6d)
mask = 11110000 (0xf0)
----------------
res = 01100000 (0x60)
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...
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...
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...
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...
Thanks!
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...