Go4Expert Founder
13Jun2007,08:50   #21
shabbir's Avatar
Quote:
Originally Posted by AHMAD
How Are You
Don't you think that should not be in this thread.
Newbie Member
25Jun2007,14:10   #22
PythonNewbie's Avatar
Can you please mail me the answers at mpolyadis@gmail.com
Thank you very much , in advance for your reply .......
Go4Expert Member
30Jun2007,18:42   #23
wrecker's Avatar
No dude, i still think that the answer is (1). Go and Google. Ya, although different compilers would use different identifier rules.
Newbie Member
2Jul2007,22:08   #24
fengxueye's Avatar
Please send me the answers for these questions
fengxueye@hotmail.com

Thanks
Light Poster
29Jul2007,10:48   #25
JamC's Avatar
Question #10
Code:
int a=10,b;
b=a++ + ++a;
printf("%d,%d,%d,%d",b,a++,a,++a);
Hmm, this is undefined- suprised nobody caught this

Question 97

Code:
int m = -14; 
int n = 6; 
int o; 
o = m % ++n; 
n += m++ - o; 
m <<= (o ^ n) & 3;
If one of the operands is negative, the sign of the result is machine dependent...
Light Poster
1Aug2007,13:12   #26
psapikas's Avatar
Hello, could u please explain to me the solution of questions #44, #51 and #91?
Thanks in advance
Go4Expert Founder
1Aug2007,14:04   #27
shabbir's Avatar
Here comes the explanation to your questions:
Question #44
increment( i ) is a local function and the value of i that is incremented inside the function will not be reflected in the main function and so the loop will never end because the loop variable is not changed.
Question #51
The condition is tested and then the loop breaks giving you the value as 5 outside the loop.
Question #91
Static variables are stored in heap and preserve the value for the execution of the program and so it does not reset for each function call where as other variable are allocated in the stack which gets destroyed when the function returns.
Light Poster
1Aug2007,17:07   #28
psapikas's Avatar
Thanks for your answers
Newbie Member
21Aug2007,19:03   #29
ec_ashish's Avatar
Please send me the answers for these questions at ec.ashish@gmail.com
Go4Expert Member
22Aug2007,21:35   #30
sudheer157's Avatar
can some one please tell me the answer for this Q?
Thanks in advance..


* sys/cdef.h */
#if defined(__STDC__) || defined(__cplusplus)
#define __P(protos) protos
#else
#define __P(protos) ()
#endif
/* stdio.h */
#include <sys/cdefs.h>
div_t div __P((int, int));
The code above comes from header files for the FreeBSD implementation of the C library. What is the primary purpose of the __P() macro?
Choice 1
The __P() macro has no function, and merely obfuscates library function declarations. It should be removed from further releases of the C library.
Choice 2
The __P() macro provides forward compatibility for C++ compilers, which do not recognize Standard C prototypes.
Choice 3
Identifiers that begin with two underscores are reserved for C library implementations. It is impossible to determine the purpose of the macro from the context given.
Choice 4
The __P() macro provides backward compatibility for K&R C compilers, which do not recognize Standard C prototypes.
Choice 5
The __P() macro serves primarily to differentiate library functions from application-specific functions.