Skip to content

Instantly share code, notes, and snippets.

@kaityo256
Created July 18, 2017 07:03
Show Gist options
  • Save kaityo256/24f78a0c8e9565c4ae95e14f8c5a3d0a to your computer and use it in GitHub Desktop.
Save kaityo256/24f78a0c8e9565c4ae95e14f8c5a3d0a to your computer and use it in GitHub Desktop.
Operations to boolean
#include <stdio.h>
int
main(void){
bool t = true;
printf("%d\n",t << 1); //=> 2
printf("%d\n",++t); //=> 1
printf("%d\n",t); //=> 1
int i = 1;
printf("%d\n",i << 1); //=> 2
printf("%d\n",++i); //=> 2
printf("%d\n",i); //=> 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment