current position:Home>Can't you call struct in the interface like this

Can't you call struct in the interface like this

2022-02-03 23:32:54 Q & A of Denglian community

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);}}

Please consult the code inside IPeople.Student Can't it work like this , Contract deployment is no problem , But the function call will fail






Other answers 1:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032332523929.html

Random recommended