5

solidity的返回值问题。为什么编译不报错。运行就出错呢?

 3 years ago
source link: https://learnblockchain.cn/question/2246
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
solidity的返回值问题。为什么编译不报错。运行就出错呢? | 登链社区 | 技术问答

solidity的返回值问题。为什么编译不报错。运行就出错呢?

function getmap() public view returns(LockUser[] memory){
LockUser[] memory datalock;
LockUser memory u1 = LockUser(true,true);
datalock[0] = u1;
LockUser memory u2 = LockUser(true,false);
datalock[1] = u2;
LockUser memory u3 = LockUser(true,false);
datalock[2] = u3;
return datalock;
}


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK