Skip to content

What is the format for functions? #766

Answered by cromewar
DatBigChungo asked this question in Q&A

You must be logged in to vote

Hello @DatBigChungo
Yes "store" and "retrieve" are the name of the functions. The reason on of them has something in the parenthesis is because is a input parameter.
On the function declaration you specify which type of variable you are returning, and when you say return favoriteNumber you are saying which is the variable you are going to return which has to be the same type as your declared.

Each language has its rules, in solidity case you specify each variable type, and also it's length (uint256 for example) because the EVM has limited resources and must know how to deal with the code.

I hope this info might help.

Replies: 1 comment

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