I see alot of libraries written in C and I like C++ OOP way.
How can I use a given C library functions in C++?
Stefano Mtangoo
455
Senior Poster
Recommended Answers
Jump to Postyou have to declare them extern "C".
#ifdef __cplusplus extern "C" { #endif // C function prototypes here #ifdef __cplusplus } #endif
You will find this example in stdio.h as well as other c header files that may also be used in c++ functions.
Jump to PostI see alot of libraries written in C and I like C++ OOP way.
How can I use a given C library functions in C++?I don't understand your question. All you need to do is include the header file and perhaps link with the library if its something unusual …
Jump to Post>>I'm speaking most particularly of GUI class frameworks.
There are no GUI frameworks in standard c++. You must be thinking of some 3d party libraries, such as wxWidgets, MFC, OpenGL, DirectX, etc. etc. None of them are part of standard c++. Maybe you should read a book about c++ to …
All 9 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Frederick2
189
Posting Whiz
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Dave Sinkula
2,398
long time no c
Team Colleague
amnoi
0
Newbie Poster
Stefano Mtangoo
455
Senior Poster
Frederick2
189
Posting Whiz
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Stefano Mtangoo
455
Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.