如何修复 "Warning: Use of the "var“关键字已弃用”?

How to fix "Warning: Use of the "var" keyword is deprecated"?


我尝试使用 auto instructor = instructors[_address] 它给了我错误:
DeclarationError: Identifier not found or not unique.

您可以先定义变量的类型,然后将它们赋给各自的值。在你的情况下是:

Instructor storage instructor = instructors[_address]