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