You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During my program I run a query and I get this result in a string { "ok": true, "result": { "message_id": 109, "from": { "id": 3456789, "is_bot": true, "first_name": "ghhdhdsh", "username": "hbdhbhbdh" }, "chat": { "id": 5678, "first_name": "ghj", "last_name": "ghj", "username": "ghj", "type": "private" }, "date": 1606112895, "text": "ddd" } }
So I created some structures
`
struct from {
int id;
bool is_bot;
string first_name;
string username;
XTOSTRUCT( O(id, is_bot,first_name,username));
};
During my program I run a query and I get this result in a string
{ "ok": true, "result": { "message_id": 109, "from": { "id": 3456789, "is_bot": true, "first_name": "ghhdhdsh", "username": "hbdhbhbdh" }, "chat": { "id": 5678, "first_name": "ghj", "last_name": "ghj", "username": "ghj", "type": "private" }, "date": 1606112895, "text": "ddd" } }
So I created some structures
`
struct from {
int id;
bool is_bot;
string first_name;
string username;
XTOSTRUCT( O(id, is_bot,first_name,username));
};
struct chat{
int id;
string first_name;
string last_name;
string username;
string type;
XTOSTRUCT( O(id, first_name,last_name,username,type));
};
struct result: public from,chat{
int message_id;
int date;
string text;
XTOSTRUCT(I(from,chat), O(message_id, date, text));
};
struct retour: public result {
bool ok;
XTOSTRUCT(I(result), O(ok));
};
`
And I want to do something like
if (retour.ok){ cout<<retour.result.chat.username<<" has received the message"; }
How can I do that, I've got some errors.
Thank you
The text was updated successfully, but these errors were encountered: