Currently I'm trying to include a library in a C header file. Here is what the original code looks like:
#ifndef SIMULATE_H
#define SIMULATE_H
#ifdef __cplusplus
extern "C" {
#endif
#define RAM_SIZE 16320
#define STRING_SIZE 10
#define BUFFER_SIZE 100
long final_hex[RAM_SIZE];
char zero[STRING_SIZE];
char stringValue[STRING_SIZE];
char buffer[BUFFER_SIZE];
char checksum[BUFFER_SIZE];
#ifdef __cplusplus
}
#endif
#endif /* SIMULATE_H */
What I want to include is "#include <math.h>
". It should be very easy, but I have some doubts here:
Does this code mean it can be a header file for both C and C++:
#ifdef __cplusplus extern "C" { #endif
When I include libraries here, shall I put before the "
extern "C"
" or after it? Does the order matter for them here?