-
Syntax questions
Code:
struct foo {}
void bar(struct foo f) {}
void bar2(foo f) {}
void test(void) {}
Is there a difference between having bar's parameter as "foo f" or "struct foo f"?
Is having void in test different from having no parameters at all?
If a function doesn't return anything, is it good practice to give it return as the last statement? E.g.
Code:
void x()
{
return;
}
-
1. No
2. No
3. Matter of style, but I'd leave it out
-
You're missing a semicolon at the end of the struct definition.
-
Note that these questions may have different answers in C. They all seem to be related to differences between C and C++.