Warning: No visibility specified. Defaulting to "public".
function setName(string newName) {
^ (Relevant source part starts here and spans across multiple lines).
Help me to resolve it ASAP. Thanks
Warning: No visibility specified. Defaulting to "public".
function setName(string newName) {
^ (Relevant source part starts here and spans across multiple lines).
Help me to resolve it ASAP. Thanks
its not an error but a warning, as the message state. You just need to add public to your function in case is the visibility scope you want to set for that specific function.
function setName(string newName) public ...
Read the documentation for more info
visibility and mutability are two parameters you should always specify to avoid any warning for more about visibility and mutability there are four type of visibility 1) public (access from anywhere) 2) private(cannot be accessed outside the smart contract) 3) external(cannot be called internally) 4) internal(can only be accessed internally within the contract and the contracts drive from it ) for more info http://solidity.readthedocs.io/en/v0.4.21/contracts.html#visibility-and-getters