Heard about after ? Look at the parameter types :)
int stat(const char *path, struct stat *buf);
What you showed in your question is really not too dramatic. You declare a variable name in the local scope, but the type names in your program are in the global scope. Now I will show you the real perverse thing:
int nooo = 0; int main() { int nooo = 0; }
W00t? Why does C ++ allow us to create two variables with the same name!?!
OK, I was joking. Now I will introduce you to the real dark sides to mess with duplicate names. Think about what C ++ allows us!
struct A { int A;
In essence, this is all for compatibility with C :)
Johannes Schaub - litb
source share