(a)
//int f() { // Return type doesn't match
string f() {
string s;
// ...
return s;
}
(b)
//f2(int i) { /* ... */ } // Must have a return type
void f2(int i) { /* ... */ }
(c)
//int calc(int v1, int v1) /* ... */ } // Forget begin brace `{`, and no two paramaters can have the same name.
int calc(int v1, int v2) { /* ... */ }
(d)
//double square(double x) return x * x; // The function body should be a block.
double square(double x) { return x * x; }