0

I get an error message on the line returnString("testing"); that says:

DeclarationError: Undeclared identifier. returnString("testing");

function returnString (string checkers) external view returns(string) {
    return checkers;
}

function getBidders() public {
    returnString("testing"); 
}

Why wont this work?

1

It is because you are calling returnString function, declared as external from internal, declared as public function. Declare returnString function as public instead since you are calling it from inside.

function returnString (string checkers) public view returns(string) {
    return checkers;
}

Look at this answer for reference.

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.