++ operator not working on array inside a function
3 weeks 2 days ago #181
by ludojoey
++ operator not working on array inside a function was created by ludojoey
Hi!
Inside a function, the ++ operator will not work on an array element.
Example:
void f1() {
byte t[1];
t[0]=1;
t[0]++;
print(t[0]);
}
This will print "1" (wrong)
void f1() {
byte t[1];
t[0]=1;
t[0]=t[0]+1;
print(t[0]);
}
This will print "2" (right)
Inside a function, the ++ operator will not work on an array element.
Example:
void f1() {
byte t[1];
t[0]=1;
t[0]++;
print(t[0]);
}
This will print "1" (wrong)
void f1() {
byte t[1];
t[0]=1;
t[0]=t[0]+1;
print(t[0]);
}
This will print "2" (right)
The following user(s) said Thank You: Franck
Please Log in or Create an account to join the conversation.
1 week 3 days ago #209
by Franck
Replied by Franck on topic ++ operator not working on array inside a function
Fixed in 0.7.9
The following user(s) said Thank You: ludojoey
Please Log in or Create an account to join the conversation.
Time to create page: 0.109 seconds