C/C++ Code and LIBRARY Mixing
I’m a native C++ programmer never knew anything about low level C, due to some circumstances I had to use C extensively. The outcome 开发者_StackOverflow社区was me catching on a lot of C habits. Know I’m trying to develop some Computer Vision project using OpenCV, TBB, OpenCL and OpenGL.
The thing is OpenCL is native C, so is TBB I guess not 100% sure about the TBB. As everybody knows C++ is an industrial Language and so Developing in it is a blast(at least for me) but after doing the main Which language should I use research? I’m know more concerned with C/C++ Code MIXING….
So my question is this Should I Develop the whole thing in C (Hard to maintain, expand and develop with) or should I stay with C++. And if I’m staying with C++ can someone plz direct me to a good way, strategy(Book, Tutorial) of mixing C/C++.
Thanks in advance.....All the technologies you mention have C++ APIs. So if you are already comfortable using that, by all means do so. There does not need to be any mixing of C and C++ in one file, at all.
Only the OpenCL kernels are written in plain (OpenCL-) C. You do not mix the code, but you may have to pass data from your C++ code to your OpenCL kernel. Since you mention you now know both, that should not be a problem.
This C++ faq lite entry should be helpful. Mixing C and CPP
精彩评论