Character bitmap with signal

#include <stdio.h> #include <signal.h> #include <unistd.h> //how_bitmap函式可將二維陣列的值輸出,輸出方式:當bit為1時輸出’*’,0輸出空白 //字元’ ’,每處理完2個byte輸出換行'\n' void update_time(int sig); char array[2][30] = { { 0x08,0x20,0x08,0x24,0xfe,0xfe,0x08,0x20, 0x00,0x00,0x08,0x20,0x04,0x40,0x04,0x40, 0x02,0x80,0x01,0x00,0x02,0x80,0x0c,0x70, 0x30,0x0e,0xc0,0x04,0x00,0x00 }, { 0x20,0x20,0x51,0xfc,0x88,0x88,0x00,0x50, 0xfb,0xfe,0x22,0x22,0x22,0x22,0xf9,0xfc, 0x21,0x24,0x21,0x24,0xa9,0x24,0x71,0x2c, 0x20,0x20,0xf8,0x20,0x00,0x00 } }; void update_time(int sig) { static int i = 0; static char *ptr = (char*)(void*)array; // change to one dimention char array int j,k; if (i < sizeof(array)) { for (j=0; j<2; j++) { for (k=7; k>=0; k--) { printf("%c", ( *(ptr+i) & (1 << k) ) ? '*' : ' '); ...