Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 프로그램
- 코스닥
- SNS
- 주가예측
- 모의 주식
- 빅데이터
- backend
- 개인프로젝트
- 풀스택프레임워크
- 코딩테스트
- java
- 개발
- 개발자
- Python
- java정리
- 자바
- 백준
- 사물인터넷
- Reflex
- 자바정리
- frontend
- 프로그래밍
- 이웃한 칸
- 코딩독학
- 자바독학
- 코딩
- Project
- 프로그래머스
- 코테
- C++
Archives
- Today
- Total
Creative Code
square(inline,매크로함수) 본문
※main.c파일
#include <stdio.h>
#include "square.h"
#define SQUARE(num) (num)*(num)
int main(void) {
//int result = square(5); // 5*5;
//int result = SQUARE(5); // 5*5;
int i = 5;
int result = square(i++); // 5*5
//int result = SQUARE(i++); // result = (i++) * (i++) = 5 * 6 = 30;
printf("result : %d\n",result);
return 0;
}
※square.h파일
#ifndef SQUARE_H
#define SQUARE_H
extern inline int square(int num) {
return num * num;
}
#endif
'C Programming' 카테고리의 다른 글
main.c(generic list) (0) | 2023.08.28 |
---|---|
main.c(리스트 createNode) (0) | 2023.08.28 |
main.c(리스트) (0) | 2023.08.28 |
main.c(queue memcpy) (0) | 2023.08.25 |
main.c(queue malloc) (0) | 2023.08.25 |