我如何避免坚固的声明错误

发布于 2025-02-12 18:59:22 字数 609 浏览 0 评论 0原文

我正在尝试在教程视频的帮助下学习区块链开发(坚固)。我对此非常新。在练习程序时有一个错误,请帮助我避免此错误。请让我知道什么是此错误的原因。

此行发生了错误:

people[] public people; 

错误是,

 DeclarationError: Identifier already declared.
  --> smart.sol:20:5:
   |
20 |     people[] public people;
   |     ^^^^^^^^^^^^^^^^^^^^^^
Note: The previous declaration is here:
  --> smart.sol:11:5:
   |
11 |     struct people {
   |     ^ (Relevant source part starts here and spans across multiple lines).  

在此处输入图像描述

I am trying to learn blockchain developing(solidity) with the help of tutorial video.and i am very new for this.There is a error while practicing the programming,please help me to avoid this error.and please let me know what is the reason for this error.

the error occurred for this line:

people[] public people; 

The error is,

 DeclarationError: Identifier already declared.
  --> smart.sol:20:5:
   |
20 |     people[] public people;
   |     ^^^^^^^^^^^^^^^^^^^^^^
Note: The previous declaration is here:
  --> smart.sol:11:5:
   |
11 |     struct people {
   |     ^ (Relevant source part starts here and spans across multiple lines).  

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文