klopex
asked on
Inserting C code into a C++ program
I am working in C++. We downloaded some C code from ITU that implements some compression algorithms. I am rather new to C++ and I want to know what is the right approach to using C code in C++.
Should I translate it all into C++ classes?
Is there a common alternate approach?
All of the code will be compiled together on Linux using g++ 3.2.x.
Should I translate it all into C++ classes?
Is there a common alternate approach?
All of the code will be compiled together on Linux using g++ 3.2.x.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You. I had been considering writing the wrapper class so I wouldn't have to edit good code. I think that is what I am going to do...
in the header file add:
extern "C" {
.. all function prototypes.
}