C/C++ Snippets

A growing collection of tiny C/C++ snippets I want to remember.

Make sure a valuable is divisable by 4

while ( 0 != (width & 0x03)) {
  ++width;
}