0
mapping(address => address) public userpatient;

I want to delete a the key value pair from above map,when the patient is discharged.How can i do it.I saw similar question here but it mentioned 'delete' identifier which is not working

  • 3
    delete userpatient[key] or userpatient[key] = address(0) – goodvibration Feb 2 at 11:37
1

Is address a struct?

Like user goodvibration has said, delete userpatient[key] would work, but since you're tagging ethereum-classic, I would like to know what version of Solidity you're running.

ETC functions with version 0.4.20 or lower due to missing OP-Codes that need to be hardforked in. 0.4.21 or higher is incompatible with Ethereum Classic.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.