当前位置:网站首页>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() {
}
边栏推荐
- Come and walk into the JVM
- 嵌入式启动流程
- Word typesetting (subtotal)
- RT-Thread 线程的时间片轮询调度
- Kaggle competition two Sigma connect: rental listing inquiries
- Priority inversion and deadlock
- 2019 Tencent summer intern formal written examination
- 5G工作原理详解(解释&图解)
- Detailed explanation of nodejs
- Some concepts often asked in database interview
猜你喜欢
优先级反转与死锁
FTP file upload file implementation, regularly scan folders to upload files in the specified format to the server, C language to realize FTP file upload details and code case implementation
MP3mini播放模块arduino<DFRobotDFPlayerMini.h>函数详解
Feature of sklearn_ extraction. text. CountVectorizer / TfidVectorizer
Fashion-Gen: The Generative Fashion Dataset and Challenge 论文解读&数据集介绍
[template] KMP string matching
RT-Thread 线程的时间片轮询调度
I2C总线时序详解
[esp32 learning-1] construction of Arduino esp32 development environment
Reno7 60W超级闪充充电架构
随机推荐
Raspberry pie tap switch button to use
选择法排序与冒泡法排序【C语言】
I2C总线时序详解
.elf .map .list .hex文件
gcc 编译选项
The first simple case of GNN: Cora classification
Linux Yum install MySQL
MySQL数据库面试题
[esp32 learning-1] construction of Arduino esp32 development environment
锂电池基础知识
物联网系统框架学习
C language, log print file name, function name, line number, date and time
Dead loop in FreeRTOS task function
Principle and implementation of MySQL master-slave replication
Encodermappreduce notes
RT-Thread 线程的时间片轮询调度
Correspondence between STM32 model and contex M
Bubble sort [C language]
Kaggle竞赛-Two Sigma Connect: Rental Listing Inquiries
Mall project -- day09 -- order module