일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 플러터
- Houdini
- 다트 언어
- c# 윈폼
- 포인터
- c#
- HTML
- Python
- 깃
- github
- Data Structure
- C++
- 구조체
- git
- c# 추상 클래스
- Algorithm
- jupyter
- c언어
- 도커
- jupyter lab
- 유니티
- C# delegate
- docker
- gitlab
- Flutter
- dart 언어
- C언어 포인터
- Unity
- c# winform
- vim
Archives
- Today
- Total
목록c언어 쉬프트 비트 연산 (1)
nomad-programmer
[Programming/C] 매크로 함수와 shift bit 연산을 이용한 정수 결합
다음은 쉬프트 비트 연산을 이용하여 4바이트를 2바이트로 분할하는 예제이다. #include #define LOWORD(x) ((unsigned short)x) #define HIWORD(x) ((unsigned int)x >> 16 & 0xFFFF) int main(int argc, const char * argv[]) { int n = 0x44434241; printf("%x\n", LOWORD(n)); printf("%x\n", HIWORD(n)); return 0; } */ 결과 4241 4443 */ 다음은 1바이트의 두 정수를 2바이트로 2바이트의 두 정수를 4바이트로 결합하는 예제이다. #include typedef unsigned char BYTE; typedef unsigned short..
Programming/C
2021. 1. 20. 03:02