Reputation: 83
Conceptual question. Consider the following code:
#include<stdio.h>
int brasa(int, float);
int brasa(int, int);
float brasa(int, int);
int main(){
return 0;
}
The compiler gives the following errors:
Line 4: error: conflicting types for 'brasa'
Line 3: note: previous declaration of 'brasa' was here
Line 5: error: conflicting types for 'brasa'
Line 3: note: previous declaration of 'brasa' was here
Which kind of message is that? Another conceptual question: do the three declarations all declare the same function?
Upvotes: 1
Views: 70
Reputation: 106022
In C you can't declare a variable/function multiple times with different types (incompatible types). There is no function overloading, unlike in C++, in C.
Upvotes: 3