当前位置:网站首页>Arduino gets the length of the array
Arduino gets the length of the array
2022-07-06 12:04:00 【A geek is as deep as the sea】
hypothesis , Currently, there is such an array
String str[]={
"ddd","ddd","dsgsd","fdsf","oooo"};
Use sizeof() function
sizeof(str) Is the total byte length of the array ,
sizeof(str[0]) Is to get the byte length of one bit in the array .
Use total byte length / One byte length .
The result is . Length of array .
Sample code
String str[5]={
"ddd","ddd","dsgsd","fdsf","oooo"};
int num;
void setup() {
Serial.begin(9600);
num=sizeof(str) /sizeof(str[0]);
Serial.print(" The length of the array :");
Serial.print(num);
}
void loop() {
}
边栏推荐
- 电商数据分析--用户行为分析
- 互联网协议详解
- Machine learning -- linear regression (sklearn)
- ESP learning problem record
- .elf .map .list .hex文件
- ARM PC=PC+8 最便于理解的阐述
- 几个关于指针的声明【C语言】
- Arm pc=pc+8 is the most understandable explanation
- Fashion-Gen: The Generative Fashion Dataset and Challenge 论文解读&数据集介绍
- The first simple case of GNN: Cora classification
猜你喜欢
E-commerce data analysis -- salary prediction (linear regression)
Reno7 60W超级闪充充电架构
Characteristics, task status and startup of UCOS III
Oppo vooc fast charging circuit and protocol
FTP文件上传文件实现,定时扫描文件夹上传指定格式文件文件到服务器,C语言实现FTP文件上传详解及代码案例实现
Kconfig Kbuild
RT-Thread的main线程“卡死”的一种可能原因及解决方案
荣耀Magic 3Pro 充电架构分析
JS object and event learning notes
Basic knowledge of lithium battery
随机推荐
锂电池基础知识
Encodermappreduce notes
ARM PC=PC+8 最便于理解的阐述
MySQL主从复制的原理以及实现
Internet protocol details
Dead loop in FreeRTOS task function
Oppo vooc fast charging circuit and protocol
Word typesetting (subtotal)
物联网系统框架学习
Principle and implementation of MySQL master-slave replication
C语言,log打印文件名、函数名、行号、日期时间
ES6语法总结--下篇(进阶篇 ES6~ES11)
uCOS-III 的特点、任务状态、启动
5G工作原理详解(解释&图解)
小天才电话手表 Z3工作原理
Détails du Protocole Internet
OSPF message details - LSA overview
Matlab learning and actual combat notes
Inline detailed explanation [C language]
Rough analysis of map file