CryptoZombies | Working With Structs and Arrays
Creating New Structsstruct Person { uint age; string name;}Person[] public people;Preson 구조체와 people 배열 선언// 새로운 사람을 생성한다:Person satoshi = Person(172, "Satoshi");// 이 사람을 배열에 추가한다:people.push(satoshi);배열 추가Preson 구조체를 사용하여 "satoshi" 사람 생성people 배열에 satoshi 추가 (push)people.push(Person(16, "Vitalik"));위와 같이 한 줄로 구조체 사용과 배열 추가 가능Array Addition Example uint[] numbers;numbers.push(5);numbers.push(1..