/* c_header.h header file that works for both C and C++ */ /* note that this works in both C and C++ because: 1) only C style comments are used 2) name mangling is turned off using extern "C" { ... } in #ifdef --cplusplus <-- a special name 3) good practice is used to be sure included just once */ #ifndef C_HEADER_H_ /* to only include once */ #define C_HEADER_H_ /* to only include once */ #ifdef __cplusplus /* make it C if in C++ compiler */ extern "C" { #endif #include /* other C header files */ void some_f(float seconds); /* types and function prototypes */ /* keep strictly C, not C++ */ #ifdef __cplusplus /* just closing } for C in C++ compiler */ } #endif #endif /* C_HEADER_H_ to only include once */