D
Dann Corbit
A web search accidentally took me to a C interview questionaire.
Here is one of the questions:
98. ajz at his interviews asks what will be printed out when the
following code is executed:
main()
{ printf("%x",-1<<4);
}
I guess that the answer they were looking for would be "the letter 'f'
for the width of the integer type on the system with the bottom nybble
cleared'.
Except that shifing left of signed integers is implementation defined.
Except that there is a varadic function (printf) with no prototype in
scope.
We also have an integer function (main) with no return value.
We also have implicit declaration of main, which is no longer allowed.
It's hard to imagine such a bad question written in such a compact way.
Here is one of the questions:
98. ajz at his interviews asks what will be printed out when the
following code is executed:
main()
{ printf("%x",-1<<4);
}
I guess that the answer they were looking for would be "the letter 'f'
for the width of the integer type on the system with the bottom nybble
cleared'.
Except that shifing left of signed integers is implementation defined.
Except that there is a varadic function (printf) with no prototype in
scope.
We also have an integer function (main) with no return value.
We also have implicit declaration of main, which is no longer allowed.
It's hard to imagine such a bad question written in such a compact way.