
Continue reading
News en vrac / WP sandbox
Linux-Ubuntu comes with native zip file support (zip and unzip). Good. Unfortunately, uncompressing RAR files (or unrar-ing files) is not handled by Ubuntu. But it’s not a big problem: just install the unrar package and you’re ok. To install unrar, start a terminal and type the following command:
Continue reading
I just discovered this macro available in C: offsetof. Here is an simple example:
struct { char a; int b; char c; } example; struct example s1; unsigned int offset; offset = (unsigned int)(&(((example *)(0))->b)); |
Thanks to offsetof (in the header stddef.h), the last line can be rewritten in:
unsigned int offset; offset = offsetof(example, b); |