Skip to content

Commit b9809b1

Browse files
author
Stefania
authored
Merge pull request #157 from per1234/calculate-element-size
Use best practices for determining the size of an array element
2 parents f02cb2d + 5133643 commit b9809b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Language/Variables/Utilities/sizeof.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Note that `sizeof` returns the total number of bytes. So for larger variable typ
7878

7979
[source,arduino]
8080
----
81-
for (i = 0; i < (sizeof(myInts)/sizeof(int)); i++) {
81+
for (i = 0; i < (sizeof(myInts)/sizeof(myInts[0])); i++) {
8282
// do something with myInts[i]
8383
}
8484
----

0 commit comments

Comments
 (0)