New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update structure-of-a-contract.rst #3977
Conversation
@@ -109,7 +109,7 @@ Struct Types | |||
============= | |||
|
|||
Structs are custom defined types that can group several variables (see | |||
:ref:`structs` in types section). | |||
:ref:`structs` in types section) and can be accessed by single name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use full stops to end sentences.
Do you want to highlight "single" in any way?
@@ -123,6 +123,16 @@ Structs are custom defined types that can group several variables (see | |||
uint vote; | |||
} | |||
} | |||
|
|||
If you want to create a new struct variable inside a function, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should rather go here: https://solidity.readthedocs.io/en/v0.4.23/types.html#structs
@@ -123,6 +123,16 @@ Structs are custom defined types that can group several variables (see | |||
uint vote; | |||
} | |||
} | |||
|
|||
If you want to create a new struct variable inside a function, | |||
and then add push it to an array, then you should create it in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not mention whether the struct variable is created inside a function, but rather only mention the intention to add a new element to a struct array.
and then add push it to an array, then you should create it in | ||
the storage space not memory space :: | ||
|
||
MyStruct memory newStruct; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example actually creates a memory object.
I don't see any value in keeping this pull request open. |
@chriseth Please keep this open. Next updated patch would be sent here. Else I would have to create new patch |
@aj07 pleise either reopen or create a new one if you add something here. |
No description provided.