//Write your own contracts here. Currently compiles using solc v0.4.15+commit.bbb8e64f. pragma solidity ^0.4.24; contract IntegerTest{ int d; function get() public pure returns (int){ int a = 1; int b = 2; int c = a/b; return c; } struct S{string a;uint b;} //默认参数是memory function assign(S s) internal pure returns(string){ //默认的变量是storage的指针 //Type struct MemoryToLocalVar.S memory is not implicitly convertible to expected type struct MemoryToLocalVar.S storage pointer. // uint[3] memory a = [uint(1), 2, 3]; // bytes4 song = "song"; // string memory str = "waylon"; // S tmp = s; return s.a; } function call() public pure returns(string){ S memory s = S("song", 1); string memory str = assign(s); return str; } }
0.4.24