Chris Thomasson said:
_________________________________________________
#include <stdio.h>
void foo(int _this) {
printf("%d\n", _this);
}
int main(void) {
foo(1);
getchar();
return 0;
}
_________________________________________________
Is this non-portable?
I am interested in the name of the variable...
Others have already described the rules regarding identifiers
beginning with underscores. Briefly, there's all reserved in some
contexts; some are reserved in more contexts than others.
Your "_this", as it turns out, is used in a context in which that
particular form of identifier is not reserved -- in other words, your
code is ok as far as the standard is concerned.
Personally, though, I find it easier to avoid using identifiers
starting with underscores altogether than to remember the rules in
detail. Looking at your code, I have to stop and think for a moment
before remembering that it's ok in this case. If you had used an
identifier *not* starting with an underscore ("this_", if you like),
then your code would be just slightly easier to read.
Part of this, I suppose, is that I've never understood the rationale
for the rules as they exist, rather than just reserving all
identifiers starting with underscores for all purposes.
It's a matter of style, not of legality.