0

enter image description here

I am unable to compile any solidity program on remix ide. The compiler just keeps on buffering. Also the compiler version is disabled. I am unable to change it. How to solve this issue?

edit: I know the previous program was incomplete. It is not compiling whether the program is complete or not. It just keeps on buffering. If the program is wrong then it should have at least shown some error.

2
  • If remix doesn't allow you to change compiler version you can empty cache and hard refresh the webpage (after backup your project).
    – kadircan
    Dec 25, 2023 at 8:36
  • It did not work.
    – SanikaM
    Dec 25, 2023 at 20:53

1 Answer 1

0

you missed a ";" after the line code number 12. Also, your code has a small issue that needs to be corrected. In the len() function, you need to implement the logic to return the length of the array. Here's the corrected code:

//SPDX-License-Identifier: MIT

pragma solidity >=0.8.2 <0.9.0;

contract array {
    uint[] public arr;
    function pushelement(uint item) public {
        arr.push(item);
    }

    function len() public view returns (uint) {
        return arr.length;
    }
}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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