UrbanPro

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do you link a C++ program to C functions?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

Computer Programming

Just include hedears file
Comments

IT Technical Trainer

If you want to use existing C functions in the C++ program, you can make use of "extern C". The compiler output for both C and C++ would be different. Extern C would give an indication to the C++ compiler to generate compiled output of the respective function in C format.
Comments

IT Trainer

In order to call a C function from C++ code, you would use the “extern “C”” keyword when declaring the function in C. Then, you would call the function just like you would call any other function. An example will help clarify this: /*this is what the C++ code would look like for the declaration...
read more
In order to call a C function from C++ code, you would use the “extern “C”” keyword when declaring the function in C. Then, you would call the function just like you would call any other function. An example will help clarify this: /*this is what the C++ code would look like for the declaration of the foo function, which is defined somewhere else in C code: */ extern "C" void foo( ); And then to call the function in the C++ code, it would look like this: //the declaration: extern "C" void foo(); void main() { // the function call: foo( ); } read less
Comments

To call a C function from C++ code, you would use the “extern “C”” keyword when declaring the function in C. Then, you would call the function just like you would call any other function.
Comments

Software Engineer

In the C++ code you need to declare the C function as extern "C"
Comments

View 3 more Answers

Related Questions

I am interested to enter IT field. But I am not from IT background. My qualification is BBM. I am planing to start with C and C++ course, but i don't have much idea about it. Can some one please let me know what is best course to start with.
if u really have interset in IT filed u better learn .net, core java, spring java, python programming languages than c and c++. but u don't know the basics programming language better going for c and c++ learning course.
Sachin
Which are the best books to learn C?
- Yashwant Kanetkar - E Balagurusamy
Kratika
What is C++
A high-level programming language developed by Bjarne Stroustrup at Bell Labs. C++ adds object-oriented features to its predecessor, C. C++ is one of the most popular programming language for graphical...
Shoaib
Is C#, C++, Python, or JS better for game development?
All languages good for gamjng. But you can make 3d games in c# uaing unity software and it's very very interesting to work on it.
Mohit
0 0
6
What is Enum?
A Java Enum is a special Java type used to define collections of constants. More precisely, a Java enum type is a special kind of Java class. An enum can contain constants, methods etc. Java enums were added in Java 5.
S

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Recommended Articles

Introduction C++ is an excellent programming language and many of the applications are written in C++ language. It has generic, object-oriented & imperative programming features, and also provides facilities for low-level memory manipulation. Successor of C language, it is an OOP (object oriented programming) language...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

Applications engineering is a hot trend in the current IT market.  An applications engineer is responsible for designing and application of technology products relating to various aspects of computing. To accomplish this, he/she has to work collaboratively with the company’s manufacturing, marketing, sales, and customer...

Read full article >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Looking for C++ Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more