Which variables get stored where in solidity?
State variables (declared directly in the smart contract) always storage.
Function arguments. Always memory (with array types like string this needs to be stated explicitly)
Local variables (in functions) of the types struct, array or mapping are stored either in memory or storage. The place needs to be stated explicitly when declaring the variable.
Local variables (in functions) of value types (e. g. uint32) always in stack