当前位置:网站首页>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() {
}
边栏推荐
- GNN的第一个简单案例:Cora分类
- 高通&MTK&麒麟 手机平台USB3.0方案对比
- 锂电池基础知识
- Distribute wxWidgets application
- Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries
- Reno7 60W超级闪充充电架构
- Oppo vooc fast charging circuit and protocol
- C language, log print file name, function name, line number, date and time
- Basic use of pytest
- Vert. x: A simple TCP client and server demo
猜你喜欢
ESP学习问题记录
arduino JSON数据信息解析
Programmers can make mistakes. Basic pointers and arrays of C language
Time slice polling scheduling of RT thread threads
PyTorch四种常用优化器测试
E-commerce data analysis -- User Behavior Analysis
Oppo vooc fast charging circuit and protocol
高通&MTK&麒麟 手机平台USB3.0方案对比
Mall project -- day09 -- order module
ES6语法总结--上篇(基础篇)
随机推荐
Unit test - unittest framework
Comparison of solutions of Qualcomm & MTK & Kirin mobile platform USB3.0
Missing value filling in data analysis (focus on multiple interpolation method, miseforest)
.elf .map .list .hex文件
Several declarations about pointers [C language]
【ESP32学习-2】esp32地址映射
Linux yum安装MySQL
機器學習--線性回歸(sklearn)
AMBA、AHB、APB、AXI的理解
Matlab learning and actual combat notes
Contiki source code + principle + function + programming + transplantation + drive + network (turn)
gcc 编译选项
Gallery's image browsing and component learning
MySQL数据库面试题
Pytorch-温度预测
[esp32 learning-1] construction of Arduino esp32 development environment
RuntimeError: cuDNN error: CUDNN_ STATUS_ NOT_ INITIALIZED
Detailed explanation of express framework
B tree and b+ tree of MySQL index implementation
[esp32 learning-2] esp32 address mapping