storage error is showing in line number 6 for string title, If I add the storage keyword in between, how does it affect my contract? Does it affect my byte code or gas consumption in later use.
The code goes by:
pragma solidity ^0.4.8;
contract token{
struct video { address vidAddress; string title; uint initialSupply; }
mapping(address=>video)videos;
function add(address vidAddress,string title,uint initialSupply){
video memory v;
v.vidAddress=vidAddress;
v.title=title;
v.initialSupply=initialSupply;
videos[vidAddress]=v;
}
}
In particular, this snippet of code:
pragma solidity ^0.4.8;
contract token{
struct video { string title; }
function add(){
}
}
produces this compiler warning on line 3:
Warning: Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence this warning.
struct video { string title; }
^----------^