Ubuntu下的Flash中文亂碼解決方法
修改/etc/fonts/conf.d/49-sansserif.conf內容
→把所有sans-serif都改成sansserif即可。
sudo vi /etc/fonts/conf.d/49-sansserif.conf
當你遇到左右為難時,其實你不需要煩惱, 代表兩方都有優點, 你的機會還比別人多
修改/etc/fonts/conf.d/49-sansserif.conf內容
→把所有sans-serif都改成sansserif即可。
sudo vi /etc/fonts/conf.d/49-sansserif.conf
#include <stdio.h>
void showBinary(int value, int size) {
int i ;
for(i=(size<<3)-1 ; i>=0 ; i--)
(value & (1<<i) ) ? putchar('1') : putchar('0') ;
}
int main() {
int i=5 ;
char j = 15 ;
//example1: show int type, value is 5
showBinary(i, sizeof(i)) ;
putchar('\n') ;
//example2: show char type, value is 15
showBinary(j, sizeof(j)) ;
getchar() ;
return 0 ;
}
恩...就左移與右移巨集函數
#include <stdio.h>
#define ROTATE_LEFT(NUM,BIT) ( \
(NUM<<BIT) | (NUM>>( (sizeof(unsigned)<<3)-BIT) ) \
)
#define ROTATE_RIGHT(NUM,BIT) ( \
(NUM>>BIT) | (NUM<<( (sizeof(unsigned)<<3)-BIT) ) \
)
int main() {
unsigned int x = 0xff000000 ;
printf("0x%8X\t0x%08X\n", x, ROTATE_RIGHT(x,4)) ;
printf("0x%8X\t0x%08X\n", x, ROTATE_LEFT(x,4)) ;
system("pause") ;
return 0 ;
}