We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1e3f6c4 commit c62cb8bCopy full SHA for c62cb8b
SampleProjects/DoSomething/do-something.cpp
@@ -4,3 +4,19 @@ int doSomething(void) {
4
millis(); // this line is only here to test that we're able to refer to the builtins
5
return 4;
6
};
7
+
8
+static const struct something table[] = {
9
+ { 1, "abc" },
10
+ { 2, "xyz" },
11
+ { 4, "123" },
12
+};
13
14
+const struct something *findSomething(int id) {
15
+ for (unsigned int i = 0; i < 3; i++) {
16
+ if (table[i].id == id) {
17
+ return &table[i];
18
+ }
19
20
+ return nullptr;
21
+}
22
SampleProjects/DoSomething/do-something.h
@@ -1,3 +1,11 @@
1
#pragma once
2
#include <Arduino.h>
3
int doSomething(void);
+struct something {
+ int id;
+ const char *text;
+const struct something *findSomething(int id);
0 commit comments