반응형 Development/헷갈리는 C언어2 [C언어]전처리기?#define의 # or ##연산자? 그게머임? #과 ##은 전처리기의 연산자로서 #define 전처리 과정에서만 사용하는 특수한 연산자이다. 사용 빈도가 높지는 않지만 잘 알아 두면 매크로의 활용도를 높여 반복되는 코드를 간단하게 작성할 수 있다. Stringizing Operator - # #define문의 인수 앞에 사용되며 피연산자를 문자열로 바꾸는 역할을 한다. 피연산자가 실인수로 치환된 후 양쪽에 따옴표를 붙여 치환된 결과 그대로 문자열 상수가 된다. #define result(exp) printf(#exp" = %d\n",exp); void main() { result(5*3); result(2*(3+1)); } 결과는 5*3 = 15 2*(3+1) = 8 Merge Operator - ## #define 문 내에서만 사용되며 형식 인수 .. 2013. 7. 17. [C언어]C언어 자료형~^^ Microsoft Visual C++ recognizes the types shown in the table below. Type Name Bytes Other Names Range of Values int * signed, signed int System dependent unsigned int * unsigned System dependent __int8 1 char, signed char –128 to 127 __int16 2 short, short int, signed short int –32,768 to 32,767 __int32 4 signed, signed int –2,147,483,648 to 2,147,483,647 __int64 8 none –9,223,372,036,854,775,80.. 2013. 7. 16. 이전 1 다음 반응형