Skip to content

Lesson 3: Query about SimpleStorage Array and SimpleStorage Object. #936

Answered by alymurtazamemon
p0lpixel asked this question in Q&A
Discussion options

You must be logged in to vote

@p0lpixel

SimpleStorage[] public simpleStorageArray;

This is called declaring an Array in solidity. In that case, this array type is SimpleStorage.

- simpleStorage simpleStorage = new SimpleStorage();
+ SimpleStorage simpleStorage = new SimpleStorage();

There is a typo mistake, correct it.

SimpleStorage simpleStorage = new SimpleStorage();

This line is creating an object of the SimpleStorage contract and we are pushing to the array after it.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@p0lpixel
Comment options

@Muchunguzi
Comment options

@p0lpixel
Comment options

@alymurtazamemon
Comment options

Answer selected by alymurtazamemon
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants