"Void" for "a function returns no value"
in
Programming Questions
•
1 year ago
I'm learning processing with "Learning Processing - A Beginners Guide To Programming Images, Animation & Interaction".
I understood you use void when a function doesn't return a value, but in a lot of examples, the function DOES return a value and is still called "void", for example (p. 175):
void rollover(int mx, int my) {
if (mx > x && mx < x + w) {
mouse = true; } else {
mouse = false;
}
} }
this returns a boolean variable "mouse", isn't it? How do I misunderstand this?
Kind regards,
John
I understood you use void when a function doesn't return a value, but in a lot of examples, the function DOES return a value and is still called "void", for example (p. 175):
void rollover(int mx, int my) {
if (mx > x && mx < x + w) {
mouse = true; } else {
mouse = false;
}
} }
this returns a boolean variable "mouse", isn't it? How do I misunderstand this?
Kind regards,
John
1