shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by AHMAD
How Are You
Don't you think that should not be in this thread.
PythonNewbie's Avatar, Join Date: Jun 2007
Newbie Member
Can you please mail me the answers at mpolyadis@gmail.com
Thank you very much , in advance for your reply .......
wrecker's Avatar, Join Date: Mar 2007
Go4Expert Member
No dude, i still think that the answer is (1). Go and Google. Ya, although different compilers would use different identifier rules.
fengxueye's Avatar, Join Date: Jul 2007
Newbie Member
Please send me the answers for these questions
fengxueye@hotmail.com

Thanks
JamC's Avatar
Light Poster
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...
psapikas's Avatar
Light Poster
Hello, could u please explain to me the solution of questions #44, #51 and #91?
Thanks in advance
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
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.
psapikas's Avatar
Light Poster
Thanks for your answers
ec_ashish's Avatar, Join Date: Aug 2007
Newbie Member
Please send me the answers for these questions at ec.ashish@gmail.com
sudheer157's Avatar, Join Date: Aug 2007
Go4Expert Member
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.