I plan to use some Linux API to finish a network program task in C++ language. All the Linux API or structure are defined in the C header file, such as <netinet/in.h>
, How to use them correctly in Cpp source file? How to use a struct defined in C header file?
Should I use C++ linkage specification? such as:
extern "C" {
#include <netinet/in.h>
};