动态长度:
uint[] a
length
push():添加成员
固定长度数组:
uint[5] a
length
struct Employee {
address id;
uint salary;
uint lastPayday;
}
Employee[] employees
function addEmployee
function removeEmployee
struct
对象不需要new
:Employee(employee, salary, now)
return
退出,避免gas
的无谓消耗var (empl, i)
可用于接收两个返回值struct
不能暴露出去,有function
需要传入或者返回struct
类型时需要设置为private
memory
中的拷贝;通过index
来修改变量的话,改变的就是storage
中的值