-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathW6day2.sol
More file actions
44 lines (35 loc) · 1.09 KB
/
W6day2.sol
File metadata and controls
44 lines (35 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
//Value types and Reference types
contract VRtypes{
uint256[] public numbers;
struct User{
uint256 balance;
}
User[] public users;
function changeMem(uint256[] memory _numb, User[] memory uzer) public {
uint256 len = _numb.length;
uint256 lenz = uzer.length;
for(uint256 i = 0; i < len; i++){
numbers.push(_numb[i]);
}
for(uint256 i = 0; i < lenz; i++){
users.push(uzer[i]);
}
}
function changestor(uint256 numb1,uint256 numb2,uint256 numb3) public {
numbers.push(numb1);
numbers.push(numb2);
numbers.push(numb3);
}
function changeCall(uint256[] calldata _numb, User[] calldata uzer) external {
uint256 len = _numb.length;
uint256 lenz = uzer.length;
for(uint256 i = 0; i < len; i++){
numbers.push(_numb[i]);
}
for(uint256 i = 0; i < lenz; i++){
users.push(uzer[i]);
}
}
}