// 1
char c = 0;
c = ~c // -1
// 2
unsigned char c = 0;
c= ~ c // 255
i = 10 ^ 8; // 1010 ^ 1000 == 0010 // 2
void GetPlayerStatus(bool status1, bool status2, bool status3, bool status4, bool status5)
{
}
int main(void)
{
GetPlayerStatus(true, false, true, false, false);
}
unsigned int status = 0;
status |= 1;
status |= 2;
#define HUNGRY 1
int main()
{
int iStatus = HUNGRY;
return 0;
}
#define HUNGRY 1
int main()
{
int iStatus = 1;
return 0;
}
#define BLEED 1
#define SLOW 2
#define STURN 4
#define SHOKR 8
#define BURN 16
#define ICE 32
#define ATT_UP 64
#define DEF_UP 128
#define DEX_UP 256
#define BLEED 0x1
#define SLOW 0x2
#define STURN 0x4
#define SHOKR 0x8
#define BURN 0x10
#define ICE 0x20
#define ATT_UP 0x40
#define DEF_UP 0x80
#define DEX_UP 0x100
#define BLEED 0x1
#define BURN 0x10
#define CLASS_DEBUF (BLEED | BURN) // 컴파일할때는 (16 | 1) 바뀜.
// 전처리기 생략.
status |= BLEED;
status |= BURN;
status |= SLOW;
if (status & BURN) //
{
printf("BURN 상태를 가지고 있다.\n");
}
status = status & ~BURN; // status &= ~Burn;
#include <stdio.h>
#include <windows.h>
// 전처리기
#define BLEED 0x1
#define SLOW 0x2
#define STURN 0x4
#define SHORK 0x8
#define BURN 0x10
#define ICE 0x20
#define ATT_UP 0x40
#define DEF_UP 0x80
#define DEX_UP 0x100
#define DEX_UP 0x200
#define DEX_UP 0x400
#define DEX_UP 0x800
#define DEX_UP 0x1000
#define DEX_UP 0x2000
#define DEX_UP 0x4000
#define DEX_UP 0x8000
#define CLASS_DEBUF (BLEED | BURN)
int main(void)
{
{
int i = 10 & 8;
i = 10 | 8;
unsigned char c = 0;
c = ~c;
i = 10 ^ 8;
unsigned int status = 0;
// 1, 2, 4, 8, 32, 64
status |= BLEED;
status |= BURN;
status |= SLOW;
status |= CLASS_DEBUF;
if (status & BURN)
{
printf("BURN 상태를 가지고 있다.\n");
}
status &= ~BURN;
if (status & BURN)
{
printf("BURN 상태를 가지고 있다.\n");
}
}
return 0;
}
1차 23.12.01
2차 23.12.05
3차 23.12.06
4차 23.12.11
5차 23.12.17
6차 23.12.24
7차 24.01.01
8차 24.01.22