Skip to content

Lesson 2: TypeError: Data location must be "memory" or "calldata" for return parameter in function, but none was given. #2682

Discussion options

You must be logged in to vote

@devtiff

- function nameGet(uint256 _practice2Index) public view returns(string){  
+ function nameGet(uint256 _practice2Index) public view returns(string memory){  

Add memory keyword along with the string in returns

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
4 replies
@Boluwatife-Aminu-Taiwo
Comment options

@alymurtazamemon
Comment options

@alymurtazamemon
Comment options

@krakxn
Comment options

Answer selected by alymurtazamemon
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Boluwatife-Aminu-Taiwo
Comment options

@alymurtazamemon
Comment options

@Boluwatife-Aminu-Taiwo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants