c++ - parsing the structure and passing as a pointer argument -


i have structure

struct ptc_configurationh20     {         float period ;         ptc_configurationh20probe probe[2] ;         uint32_t padding ;        }ptc_pack;     struct ptc_configurationh20probe     {         uint32_t probeserialnumber;         uint8_t probetype;         uint8_t range;         uint8_t mode;         uint8_t padding1;         ptc_h20pidparameters pid;         uint32_t padding;     }; 

i read above ptc_configurationh20 structure data as

h20::ptc_configurationh20* tempconfiguration                     = reinterpret_cast<h20::ptc_configurationh20*>(message->getdata());  

i need pass pointer object pid probe[0], function

bool setpidconfiguration(uint8_t probenumber, const h20::ptc_h20pidparameters& calib,                              ptc_return* ret); 

please help

i need pass pointer object pid probe[0], function

given:

h20::ptc_configurationh20* tempconfig; 

and given setpidconfiguration takes 2nd argument const reference h20::ptc_h20pidparameters (assuming h20 namespace qualifier), 1 able following:

setpidconfiguration( notrelevant, tempconfig->probe[0].pid, notrelevant ); 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -