Created
October 5, 2021 10:02
-
-
Save sepisoltani/65b3d8e710f0063e4099b3e44a427a7b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
contract Example{ | |
struct Person { | |
uint age; | |
string name; | |
} | |
Person[] public people; | |
function createNewPersonAndAddToArray() public { | |
// create a New Person: | |
Person sepehr = Person(25, "sepehr"); | |
// Add that person to the Array: | |
people.push(sepehr); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment