I’m trying to store an array of structs with each struct having pointers but I get a “initialization makes pointer from integer without a cast” message in creating the array.
struct fl_valueags {
tcflag_t *fl_value;
flagtype_t *fl_type;
};
...
struct fl_valueags t_flags[] = { { ttyinfo->c_iflag, INPUT }, {
ttyinfo->c_oflag, OUTPUT }, { ttyinfo->c_cflag, CONTROL }, {
ttyinfo->c_lflag, LOCAL } };
You should pass the address of
c_iflag:Regarding the
fl_type, it should probably be declared as a value, not a pointer (unless INPUT, OUTPUT CONTROL and LOCAL are pointers):