일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
Tags
- 포인터
- Python
- Data Structure
- vim
- 구조체
- 깃
- c#
- 유니티
- Flutter
- C# delegate
- C++
- git
- 도커
- jupyter
- Algorithm
- C언어 포인터
- github
- HTML
- docker
- dart 언어
- c언어
- c# 추상 클래스
- gitlab
- c# winform
- 플러터
- Unity
- 다트 언어
- jupyter lab
- Houdini
- c# 윈폼
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