일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- vim
- Houdini
- 유니티
- 도커
- jupyter lab
- C++
- 다트 언어
- c언어
- 깃
- Flutter
- docker
- github
- 포인터
- c#
- C언어 포인터
- Algorithm
- Unity
- Data Structure
- git
- jupyter
- c# winform
- 구조체
- 플러터
- c# 추상 클래스
- dart 언어
- c# 윈폼
- Python
- C# delegate
- gitlab
- HTML
Archives
- Today
- Total
목록열거형 (1)
nomad-programmer
[Programming/C] 구조체와 열거형 그리고 함수 포인터
열거형을 구조체의 멤버로 등록하고 사용하는 예제이다. #include // 열거형 정의 enum play_type { RUN, STOP, ATTACK }; // response 구조체안에 열거형을 멤버로 넣었다. typedef struct { char *name; enum play_type type; } response; void run(response r) { printf("%s\n", r.name); puts("run!"); } void stop(response r) { printf("%s\n", r.name); puts("stop!"); } void attack(response r) { printf("%s\n", r.name); puts("attack!"); } int main(void) { res..
Programming/C
2020. 6. 18. 01:09