pragma solidity ^0.4.0;contract test { uint [5] T =[1,2,3,4,5] ;//固定长度的数组:可修改数组内值大小,不支持push,不可更改长度 /* contract test { uint [] T = new uint[](5); //ParserError: Expected identifier but got 'storage' //全局数组,默认创建在storage中,无法创建在memory中,长度可修改 function setlength(uint aa){ uint [] memory a = new uint[](5); bytes [] memory b = new bytes[](5); //TypeError: Type bytes memory[] memory is not implicitly //convertible to expected type bytes storage ref[] storage pointer. //函数内创建数组,需要指定存储在memory中,a.length不可更改 //a.length = 10; // TypeError: Expression has to be an lvalue a[2] = 5; } } */ function setValue(uint para){ T[0] = para; } /* uint [] T =[1,2,3,4,5] ; //动态长度的数组:可修改数组内值大小,支持push,可更改长度 /* uint [] T1 = new uint[](5); constructor() public{ for (uint i;i可变大小字节数组 bytes3 a; bytes [] b = new bytes[a.length] for (uint i;i