0

How to access the below fields of this structure using lib curl write_data pointer variable.

typedef struct RESPONSE { char* msg;
char* sn;
char* gsn;
char* veType;
char* model;
char* deviceKey;
char* responseCode; }responsedata , responseptr;

I should fill the below values for each member variable of the above structure. The values to be filled are :

{"message":"RequestApproved","serialNumber":"567123","model":"QPPR","deviceKey" :"d64225486abc4b449bcb9f4e51af31b2e00a9a3b639482b50cd4cc3cee854823588b91565ae2a2 8defcd89dfaeb601c587cdce7a8c6c6f94c593a050dd60376d","responseCode":0,"gatewaySer ialNumber":"c177a3c9-d892-4975-8df8-662059c2aec6","veType":"XXLite"}

I used the below curl functions

curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &resp);

Please help me to fill the structure member variables using the resp pointer.

2
Contributors
1
Reply
6
Views
2 Years
Discussion Span
Last Post by gusano79
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.