If I make a function let’s say: boolean setSomeValues(int mode);
Then I could use the returned value from the function to check if the operation went OK.
But sometimes I just want to call the function and not check the result.
Is it good practice to omit the returned result?
i.e
setSomeValues(mode);
instead of
Ok = setSomeValues(mode);
That is entirely up to you to decide. The compiler will not care. The Arduino will not care. It is fairly common to ignore a return value so most people on this side of your monitor will not care.
Is it good practice to omit the returned result?
i.e
setSomeValues(mode);
instead of
Ok = setSomeValues(mode);
There is not much point in having a function that returns a value and then not using it. On the other hand if you don't need a returned value then why bother returning one ?
UKHeliBob:
There is not much point in having a function that returns a value and then not using it. On the other hand if you don't need a returned value then why bother returning one ?
Many C programmers have been writingprintf("Hello world\n"); for what seems like centuries. If you want make your intentions clear, write