I am new to solidity, and I’m trying to wrap my head around memory, it seems we use the memory keyword when dealing with strings, structs etc… in functions, how come we dont do the same when passing in a uint? (at least in my crypto zombies tutorial)
e.g
function createObject(string memory _name, uint _dna) public {
object.push(Object(_name, _dna));
>Solution :
Data location (memory, storage, and calldata) needs to be specified for reference type variables.
Since uint is a value type, its is’t specified.