(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 `{`
int calc(int v1, int v1) { /* ... */ }
(d)
//double square(double x) return x * x; // The function body should be a block.
double square(double x) { return x * x; }