Using the suggested #define is fine, as indicated by my first example, or the equivalent passing the constant address
Code:
const char UNIT1[] = "kPa"; const char UNIT2[] = "ft";
const char UNIT1[] = "kPa"; const char UNIT2[] = "ft";
float var_1, var_2;
const char* const UNIT1 = "kPa";
const char* const UNIT2 = "ft";
struct PARAMETER
{
float* value;
int par_type;
int max_index;
float init;
float min;
float max;
float step;
char* unit;
};
const struct PARAMETER params[]
float fval;
int ival;
char sval[100];
const STR_INIT[]="ggwegweggegggwgwgw";
enum
{
DAT_BYTE=0,
DAT_INT,
DAT_FLOAT,
DAT_STRING
};
struct
Leave a comment: