File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ contract StructTypes {
4343 // 给结构体赋值
4444 // 方法1:在函数中创建一个storage的struct引用
4545 function initStudent1 () external {
46- Student storage _student = student; // assign a copy of student
46+ Student storage _student = student; // assign a reference to student
4747 _student.id = 11 ;
4848 _student.score = 100 ;
4949 }
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ Student student; // 初始一个student结构体
115115// 给结构体赋值
116116// 方法1:在函数中创建一个storage的struct引用
117117function initStudent1() external{
118- Student storage _student = student; // assign a copy of student
118+ Student storage _student = student; // assign a reference to student
119119 _student.id = 11;
120120 _student.score = 100;
121121}
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ contract StructTypes {
4444 // assign value to structure
4545 // Method 1: Create a storage struct reference in the function
4646 function initStudent1 () external {
47- Student storage _student = student; // assign a copy of student
47+ Student storage _student = student; // assign a reference to student
4848 _student.id = 11 ;
4949 _student.score = 100 ;
5050 }
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ You can define new types in the form of `struct` in Solidity. Elements of `struc
9393 // assign value to structure
9494 // Method 1: Create a storage struct reference in the function
9595 function initStudent1() external{
96- Student storage _student = student; // assign a copy of student
96+ Student storage _student = student; // assign a reference to student
9797 _student.id = 11;
9898 _student.score = 100;
9999 }
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ contract StructTypes {
4444 // assign value to structure(構造体への値の代入)
4545 // Method 1: Create a storage struct reference in the function(関数内でstorage型の構造体の参照を作成する)
4646 function initStudent1 () external {
47- Student storage _student = student; // assign a copy of student(構造体studentのコピーを代入する )
47+ Student storage _student = student; // assign a reference to student(構造体studentへの参照を代入する )
4848 _student.id = 11 ;
4949 _student.score = 100 ;
5050 }
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ Solidityにおいて、`struct`というフォーマットによって新しい
9494 // Method 1: Create a storage struct reference in the function
9595 //(方法1: 関数にてstorage型構造体の参照を作成する)
9696 function initStudent1() external{
97- Student storage _student = student; // assign a copy of student
97+ Student storage _student = student; // assign a reference to student
9898 _student.id = 11;
9999 _student.score = 100;
100100 }
You can’t perform that action at this time.
0 commit comments