EOS.IO Asked by Jimmy Sullivan on August 20, 2021
I am trying to create a custom struct called Student in a contract. Where do I declare or define the struct? I tried to define it in the abi file, but the file was over written when I compile the contract.
struct Student {
uint id;
string content;
bool present;
}
In traditional development defining structs depends a bit on the architecture of the software and certain conventions but I'll neglet this in this post.
To give you a simple eosio-sepcific answer:
Simply do:
struct student_t {
uint id;
string content;
bool present;
}
somewhere at the top of your contractname.hpp (within or outside of the contract-class).
Answered by cmadh on August 20, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP