I am trying to build a simple contract where contract A has a function that just returns the first item in an array stored in another contract B. I keep receiving the following error. It does not seem to like strings!
Type error: Type void is not implicitly convertible to expected type string memory.
return contractB.getAttributeZero();
contract B {
string[10] attributes;
function B() {
attributes[0] = "Pets";
}
function getAttributeZero() constant returns(string) {
return attributes[0];
}
}
contract A {
function getAttribute() constant returns(string) {
B contractB = new B();
return contractB.getAttributeZero();
}
}
Comments
They can, on the other hard, return dynamically-sized objects to the "outside".