mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			382 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			382 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract C {
 | |
|     bytes16[] public data;
 | |
| 
 | |
|     function f(bytes32 x) public returns (bytes1) {
 | |
|         return x[2];
 | |
|     }
 | |
| 
 | |
|     function g(bytes32 x) public returns (uint256) {
 | |
|         data = [x[0], x[1], x[2]];
 | |
|         data[0] = "12345";
 | |
|         return uint256(uint8(data[0][4]));
 | |
|     }
 | |
| }
 | |
| // ----
 | |
| // f(bytes32): "789" -> "9"
 | |
| // g(bytes32): "789" -> 0x35
 | |
| // data(uint256): 0x01 -> "8"
 |