10.07.2015 Views

PDF version - ARM Information Center

PDF version - ARM Information Center

PDF version - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C, C++ 및 어셈블리 언어 조합4.3.2 사용자 고유의 C 헤더 파일 포함사용자 고유의 C 헤더 파일을 포함하려면 extern "C" 문에서 #include 지시어를 래핑해야 합니다. 다음 방법으로 이 작업을 수행할 수 있습니다.• 파일이 포함 (#include) 되어 있는지 확인합니다 (예제 4-2 참조) .• 헤더 파일에 extern "C" 문을 추가합니다 (예제 4-3참조) .예제 4-2 파일을 포함하기 전의 지시어// C++ codeextern "C" {#include "my-header1.h"#include "my-header2.h"}int main (){// ...return 0;}예제 4-3 파일 헤더의 지시어/* C header file */#ifdef __cplusplus /* Insert start of extern C construct */extern "C" {#endif/* Body of header file */#ifdef __cplusplus /* Insert end of extern C construct. */} /* The C header file can now be */#endif /* included in either C or C++ code. */4-6 Copyright © 2002-2008 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0203IKNon-ConfidentialUnrestricted Access

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!