난 정말 최고야 멋있어
C/C++ 전처리기에서의 #,## 본문
#include <iostream>
#include <typeinfo>
#define cat(a,b) (a##b)
#define str(a) #a
using namespace std;
int main()
{
int hello = 3;
cat(hel, lo) = 7;
cout << hello << endl;
cout << str(hello) << endl;
cout << typeid(str(hello)).name() << endl;
return 0;
}
결과
7
hello
char const [6]
## 은 입력받은 것들을 이어주는 역할
# 은 문자열(const char*)로 치환해주는 역할을 한다