Created
July 15, 2022 08:30
-
-
Save swkim109/8a824d7c13664f968ad63d9c7be4900e to your computer and use it in GitHub Desktop.
struct array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier:MIT | |
pragma solidity ^0.8.0; | |
contract MyContract { | |
struct Member { | |
uint256 age; | |
string name; | |
} | |
struct StudyGroup { | |
uint256 groupId; // value 타입의 필드가 있어야 컴파일이 된다. | |
Member[] members; | |
} | |
StudyGroup[] public groups; // 구조체 배열의 원소가 다시 구조체를 nest하고 있는 경우 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment