August 2019
Intermediate to advanced
486 pages
13h 52m
English
Just like other languages such as C++, Solidity also supports defining structs. Structs are custom-defined data types that can group multiple variables in a single struct variable to form a new type.
By default, all struct values are initialized using their default values. For example, uint values will be initialized with 0; bool values will be initialized with false; and address values will be initialized with 0x0, as follows:
contract LoanStruct { //Definition of struct struct LoanData { address borrower; address lender; uint256 loanAmount; }}