How to call a C++ function which is compiled with C++ compiler in C code?



How to call a C++ function which is compiled with C++ compiler in C code?..

Answer / Vishal Kumar Jaiswal

To call a C++ function from C code, you'll first need to compile your C++ code as a shared library (.dll on Windows and .so on Linux). Then, use the appropriate function loading mechanism for your platform (e.g., dlopen in Linux or LoadLibrary/GetProcAddress in Windows) to load the library and call the exported functions.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

Which method protects back button to retrieve old value from previous page in Struts.

1 Answers  


shall we execute our java programmes in jre

1 Answers  


73. How can you set the status and title for a modal dialog box? a) In the attributes of the corresponding screen. b) Before the corresp. call screen statement. c) In a PBO module of the corresponding screen. d) In the PAI module of the corresponding screen.

1 Answers  


Diff.b/w Frames and container?

1 Answers   Tech Mahindra, Wipro,


How to set on/off a group of indicators in a single statement?

1 Answers  


THERE ARE 4 SOURCE FILES WHICH CONTAINS SAME METADATA CREATE A TARGET THAT SHOULD DISPLAY THE FILE NAME ALONG WITH THE RECORD PLEASE SEND THE ANSWERFOR THIS QUESTION WITH MAPPING

1 Answers   Wipro,


what are the difference between C,C++and Java

1 Answers   Wipro,


Busy waiting is a method whereas a taskwaits for a given event by continiously checking for an event to occur. What is the main problem with this approach

1 Answers  


what is software

2 Answers  


Given three sides of a triangle. Write the Program to determine whether the triangle is : 1) Invalid 2) Right Angled 3) Isoscales 4) Equilateral 5) Not Special An Isoscales right angled triangle should be taken as a Right Angled Triangle

3 Answers   FFC, Goldman Sachs, Student,


6.int x=10; float y=20; a=x%2=? b=y%2=?

1 Answers  


what is the similarity between networking devices?

1 Answers   Cygnus, Infosys,


Categories