I was wondering which of these three methods is faster and better optimized (in C) considering that myFunc() will be called multiple times and that the variable will be compared and changed:
1 - Creating every time a new variable:
char myFunc( void ) {
char c;
// code
return c;
}
2 - Passing a pointer as argument:
void myFunc( char *_ptrC ) {
// code (no need for return since _ptrC is a pointer)
}
3 - Passing a variable and returning it:
char myFunc( char _c ) {
// code
return _c;
}