Error message: name lookup of ‘jj’ changed for ISO ‘for’ scoping, (if you use ‘-fpermissive’ G++ will accept your code)

前端 未结 4 1194
谎友^
谎友^ 2021-01-02 10:28

The error is:

In function ‘int returnShortestWeightedBranch(std::vector >*)’:
error: name lookup of ‘jj’ changed for         


        
4条回答
  •  孤城傲影
    2021-01-02 10:35

    You have a semicolon at the end of the inner for statement. That ends the scope of jj there, so it is not visible inside the block.

    Edit
    You have solved the scope problem, but still have your for loop executing just

    ;
    

    Remove the semicolon after the parenthesis!

提交回复
热议问题