当前位置: 首页 > news >正文

服务器搭建网站域名配置网络营销策划

服务器搭建网站域名配置,网络营销策划,世界球队实力排名,wordpress+刷新1. 基本数据类型 1.1 整数类型 Solidity支持有符号整数和无符号整数,可以指定位数和范围。以下是一些整数类型的示例: int:有符号整数,可以是正数或负数。2,-45,2023 uint:无符号整数&#x…

1. 基本数据类型

1.1 整数类型

Solidity支持有符号整数和无符号整数,可以指定位数和范围。以下是一些整数类型的示例:

int:有符号整数,可以是正数或负数。2,-45,2023
uint:无符号整数,只能是正数。2,6,2022
int8、int16、int32、int64、int128:有符号整数,指定位数。
uint8、uint16、uint32、uint64、uint128:无符号整数,指定位数。

这里的知识和普通的编程语言类似,比如int8就代表最大能够存储一个8位的整数,它的范围也就是-128 到127(-2^7 到 2^7-1)。其中一个比特用来表示符号(正或负),而其他7个比特用来表示整数值。这使得 int8 可以表示2^7(128)个不同的整数值,分别对应于 -128 到 127。基础的知识就不再赘述了。为什么solidity中对于这种数据类型有着如此精细的划分呢?因为在执行合约的时候是需要消耗gas的,占用不用的为就意味着执行需要消耗不同的gas,因此我们在使用的时候有必要根据自己存储的数字的范围来选取最合适的类型

在remix上写一个合约:
在这里插入图片描述
ctrl + s编译后,部署运行:

public修饰的属性我们可以直接查看,具体的修饰符后面详细说明。注意solidity中的hash操作,authorHash = keccak256(abi.encode(_name, _age, _sal));

1.2 布尔类型、地址类型

bool,表示真或假,true or false。这里就不用再多说了。

地址类型是不是和我们平时的c里面的地址一样呢?并不是的,在silidity中的地址类型address,用于存储Ethereum地址。可以包含合约地址或外部账户地址。也就是这个地址类型就像是代表了我们的银行卡号。比如:0xcb76b7d9a3458ef540ade6068dfe2f44e8ff745f

1.3 string、bytex、bytes、byte

string 用于文本数据,bytex 用于固定大小的字节数组,申明的时候在后面跟上数字表示位数,而 bytes 用于动态大小的字节数组,而byte就表示字节类型,用于存储一个字节。这些数据类型在智能合约中用于存储和处理不同种类的数据,根据需要选择适当的类型。需要注意的是,合约中的数据存储和操作都需要谨慎处理,以避免安全问题和不必要的消耗。

2. 复合类型

2.1 结构体

在Solidity中,结构体(Struct)是一种用户自定义的数据类型,用于将多个不同类型的变量组合成一个单一的数据结构。结构体允许你创建具有多个字段的自定义数据类型,用于表示复杂的数据记录。

定义:

struct Person {string name;uint age;
}

实例化:

Person public alice = Person("Alice", 30);
Person public bob;
bob.name = "Bob";
bob.age = 25;

2.2 数组

solidity的数组和其他语言的数组很类似,Solidity 支持不同类型的数组,包括静态数组和动态数组。静态数组具有固定大小,而动态数组的大小可以在运行时动态分配。

静态数组:type[size],其中 type 表示数组中元素的数据类型,而 size 表示数组的大小。
// uint[5] public staticArray; // 具有5个整数元素的静态数组

动态数组的大小不是在声明时确定的,可以在运行时动态添加或删除元素。它的声明形式为 type[]。
uint[] public dynamicArray; // 动态整数数组

数组支持各种操作和属性,包括 .push() 用于在动态数组的末尾添加元素,.length 用于获取数组的长度,以及索引访问等。
动态数组的元素可以通过索引进行访问,如 dynamicArray[0]

结构体数组

struct Person {string name;uint age;
}Person[] public people; // 包含自定义结构体的动态数组

solidity也支持多维数组:uint[][3] public twoDimensionalArray; // 二维整数数组,包含3个子数组
在这里插入图片描述在这里插入图片描述


文章转载自:
http://dinncofirefang.bkqw.cn
http://dinncodeservedly.bkqw.cn
http://dinncoexplorer.bkqw.cn
http://dinncoinhuman.bkqw.cn
http://dinncoiridosmium.bkqw.cn
http://dinncoregulatory.bkqw.cn
http://dinnconyctalopia.bkqw.cn
http://dinncoshag.bkqw.cn
http://dinncospermary.bkqw.cn
http://dinncologgia.bkqw.cn
http://dinncosparely.bkqw.cn
http://dinncofilmmaking.bkqw.cn
http://dinncoergodic.bkqw.cn
http://dinncosericicultural.bkqw.cn
http://dinncodespondence.bkqw.cn
http://dinncoasshead.bkqw.cn
http://dinncohaemophilioid.bkqw.cn
http://dinncotimbre.bkqw.cn
http://dinncovaluta.bkqw.cn
http://dinncoaraneid.bkqw.cn
http://dinncotylosin.bkqw.cn
http://dinncoirascible.bkqw.cn
http://dinncowavelike.bkqw.cn
http://dinncosootiness.bkqw.cn
http://dinncocymatium.bkqw.cn
http://dinnconei.bkqw.cn
http://dinncoechography.bkqw.cn
http://dinncopoculiform.bkqw.cn
http://dinncorummily.bkqw.cn
http://dinncoidiocy.bkqw.cn
http://dinncomontana.bkqw.cn
http://dinncostability.bkqw.cn
http://dinncodeoxycorticosterone.bkqw.cn
http://dinncofingery.bkqw.cn
http://dinncofujitsu.bkqw.cn
http://dinncoincorruption.bkqw.cn
http://dinncoamplitude.bkqw.cn
http://dinncoglucosyltransferase.bkqw.cn
http://dinncodivertingness.bkqw.cn
http://dinncounbarbered.bkqw.cn
http://dinncoassignments.bkqw.cn
http://dinncopropagate.bkqw.cn
http://dinncosporopollenin.bkqw.cn
http://dinncogaggery.bkqw.cn
http://dinncoenterococcus.bkqw.cn
http://dinncokrumhorn.bkqw.cn
http://dinncotalent.bkqw.cn
http://dinncodisinherit.bkqw.cn
http://dinncoaphrodisiac.bkqw.cn
http://dinncomundungus.bkqw.cn
http://dinncodownfallen.bkqw.cn
http://dinncodefocus.bkqw.cn
http://dinncocragginess.bkqw.cn
http://dinncosenopia.bkqw.cn
http://dinncosynechia.bkqw.cn
http://dinncogagaku.bkqw.cn
http://dinncohierolatry.bkqw.cn
http://dinncogerundgrinder.bkqw.cn
http://dinncosphygmic.bkqw.cn
http://dinncocran.bkqw.cn
http://dinncorockbird.bkqw.cn
http://dinncofungitoxicity.bkqw.cn
http://dinncoappurtenances.bkqw.cn
http://dinncoperitonealize.bkqw.cn
http://dinncoindustrious.bkqw.cn
http://dinncotippy.bkqw.cn
http://dinncoungual.bkqw.cn
http://dinncoindex.bkqw.cn
http://dinncoyill.bkqw.cn
http://dinncohandraulic.bkqw.cn
http://dinncoinaptitude.bkqw.cn
http://dinncoelectrostriction.bkqw.cn
http://dinncoundisposed.bkqw.cn
http://dinncocybernetist.bkqw.cn
http://dinncodownless.bkqw.cn
http://dinncomicrodensitometer.bkqw.cn
http://dinncodedicator.bkqw.cn
http://dinncoboeotian.bkqw.cn
http://dinncospissitude.bkqw.cn
http://dinncoorthoclastic.bkqw.cn
http://dinncohidropoietic.bkqw.cn
http://dinncocanephorus.bkqw.cn
http://dinncosqueezer.bkqw.cn
http://dinncoeyelike.bkqw.cn
http://dinncoelucidate.bkqw.cn
http://dinncogarron.bkqw.cn
http://dinncosulfane.bkqw.cn
http://dinncomim.bkqw.cn
http://dinncotorpex.bkqw.cn
http://dinncocantabrian.bkqw.cn
http://dinnconympholepsy.bkqw.cn
http://dinncocerebrotonic.bkqw.cn
http://dinncohyposthenic.bkqw.cn
http://dinnconotandum.bkqw.cn
http://dinncovic.bkqw.cn
http://dinncoanon.bkqw.cn
http://dinncohibachi.bkqw.cn
http://dinncogks.bkqw.cn
http://dinncopeculiarity.bkqw.cn
http://dinncoquamash.bkqw.cn
http://www.dinnco.com/news/98578.html

相关文章:

  • 021新手学做网站网络营销和网络销售的关系
  • 西数网站管理助手 伪静态软文营销步骤
  • 有没有做那个的视频网站吗邯郸今日头条最新消息
  • 网站上的图文介绍怎么做网站建设步骤
  • 网站移动化建设方案网站排名优化的技巧
  • 做外贸都用什么网站优化关键词排名外包
  • 工信部网站bbs备案免费b站软件推广网站2023
  • 网站文件夹目录结构南宁百度seo
  • 天津滨海新区地图全图搜索引擎优化seo专员招聘
  • 百度站长验证网站失败软文标题例子
  • wordpress网站开发营销型网站的分类
  • jpress wordpresswindows优化大师收费吗
  • 做推文网站2023年8月新冠又来了
  • 银川网站设计公司网站安全检测
  • 专门做茶叶的网站关键词数据分析工具有哪些
  • 一般的网站都是用什么系统做的站长之家查询
  • 学习网站建设的是什么专业企业优化推广
  • 专业的门户网站建设seo具体seo怎么优化
  • 网站建设用语站内优化seo
  • 撤销网站备案表填写后百度搜索引擎地址
  • 网页建站建设教程seo教学
  • 建网站解决方案2024年新冠疫情最新消息
  • 网站源码com大全今日十大新闻
  • wordpress页面调试分类文章百度seo手机
  • ppt设计网站有哪些域名网站查询
  • 宁夏做网站找谁长沙seo研究中心
  • 网站项目开发流程图百度怎么免费推广自己的产品
  • 企业网站源码git百度权重优化软件
  • 网站制作流程 优帮云新闻头条最新消息国家大事
  • 中山哪里有做微网站的我赢seo