I am currently a beginner to solidity programming. However, I am getting an error when I try to send an array for an argument for a function.

constructor() {
    addQuestion('Is this a question?', ['Yes', 'No']);

function addQuestion(string memory _title, string[] memory _answers) private {

I am getting an error that implicit conversion from 'string memory[2] memory' to 'string memory[] memory' requested

Your Answer

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

Browse other questions tagged or ask your own question.