面试问题,盼答案
1) Why is this program not portable:
#include
#include
/* This function returns a value in which bit 'n' is set. Bits are
counted from right to left. The rightmost bit (the least significant
bit) is bit #0. */
long
set_bit(unsigned n)
{
assert(n
return 1
}
2) A flex input file contains this regular expression that is supposed
to match a C comment. Is it correct? If not, why not.
"/*""/"*([^*/]|[^*]"/"|"*"[^/])*"*"*"*/"
3) In Perl, what's the difference between "my" and "local"? When should
"local" be used?