5

这样调用接口里面struct不行吗

 3 years ago
source link: https://learnblockchain.cn/question/1737
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.
这样调用接口里面struct不行吗 | 登链社区 | 技术问答

这样调用接口里面struct不行吗

pragma solidity ^0.6.0;
pragma experimental ABIEncoderV2;
interface IPeople {

    struct Student {
        uint status;
        
    }
      function getStudent(address _productAddr) external view returns (Student memory) ;
}


pragma solidity >=0.6.0;

contract Want  {

IPeople public _people =IPeople(0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC) ;   

function hi()external {
    address _pAddr = 0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB;
    IPeople.Student memory _p = _people.getStudent(_pAddr);

}
  
}

请教一下代码里面的 IPeople.Student 不能这样用吗,合约部署没问题,但是函数调用会失败


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK