I'm trying to inherit from a contract. I'm expecting the child contract to have the same constructor as the parent (or be overwritten)
pragma solidity ^0.4.2;
contract parent{
string public name;
function parent(string _name){
name=_name;
}
}
contract child is parent{}
If I try
contract child2 is parent{
function child2(string _name){
name=_name;
}
}
Then the string entered at construction, that should go into name, doesn't get stored.
What's going on? How do constructors work with inheritance?
Thanks in advance.