I am familiar with the extern keyword, it is used to declare a variable present in some other file, but what does the following statement mean??
extern "C" const IMAGE_DOS_HEADER __ImageBase;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It means do not mangle the symbol name
__ImageBasethat follows theextern "C". In short it ensures you can use the variable in C++ code.extern "C"specify’s the linkage to be applied. In short a Linkage specification.It tells the C++ compiler to apply linkage of the type of C to the symbol that follows.
Good Read:
Using extern to Specify Linkage
How to mix C and C++