- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why do we use extern "C" in C++ code?
45 Lectures 4.5 hours
66 Lectures 5.5 hours
You need to use extern "C" in C++ when declaring a function that was implemented/compiled in C.
Using extern "C" lets the compiler know that we want to use C naming and calling conventions. This causes the compiler to sort of entering C mode inside our C++ code. This is needed because C++ compilers mangle the names in their symbol table differently than C compilers and hence behave differently than C compilers.
- Why do we use modifiers in C/C++?
- Why do we use internal keyword in C#?
- Why do we use comma operator in C#?
- Why do we use restrict qualifier in C++?
- Why do we use const qualifier in C++?
- Why do we use the params keyword in C#?
- Why do we use a volatile qualifier in C++?
- Why do we use interfaces in Java?
- Why do we use random.seed() in Python?
- Why do we use pandas in python?
- When to use extern in C/C++
- Why do we use JSON.stringify() method in jQuery?
- Why do we use DOCTYPES in HTML document?