c++ - memcpy qt and compile error -
i have function
scalibration(uint8_t number, const abc::report& report, return* ret) { uint8_t args[2]; args[0]=number; memcpy(&(args[1],&report,sizeof(abc::report))); }
where report structure in file abc different data types . when tried compile error "l value requires unary & operand.
please help
memcpy(&(args[1],&report,sizeof(abc::report)));
should be
memcpy(&(args[1]),&report,sizeof(abc::report));
you should ensure args
sufficiently large hold result.
Comments
Post a Comment