printf("ho_tari\n");

letterAttribute 본문

C

letterAttribute

호타리 2023. 9. 1. 09:35
#include <stdio.h>

//#define BOLD 0x01

#define BOLD   (0x01 << 0)

#define ITALIC (0x01 << 1)

#define SHADOW (0x01 << 2)

#define UL     (0x01 << 3)



int main(void)

{

	unsigned char attr;

	

	attr = attr ^ attr;             // attr = 0;

	attr = attr | BOLD;             // 00000001

	attr = attr | (SHADOW + ITALIC);    // 00000110

	attr = attr & ~BOLD;

	

	printf("attr: 0x%02x\n", attr);

	

	return 0;

}

 

<compile 결과>

'C' 카테고리의 다른 글

limits  (0) 2023.09.01
letterAttribute2  (0) 2023.09.01
isOrdinary  (0) 2023.09.01
isLeap  (0) 2023.09.01
incrementor  (0) 2023.09.01