Original Post
Hi, I was wondering which of the following methods is most commonly used when validating parameters for a function. Is there some guideline to follow? In my case, the parameters will be valid most of the time.
void myfunc(param)
{
if(paramValidated) {
//perform function
} else {
//set error flag
}
}
void myfunc(param)
{
if(paramValidated) {
//perform function
return;
}
//set error flag
}
void myfunc(param)
{
if(!paramValidated) {
//set error flag
return;
}
//perform function
}