What is the hidden bug with the following statement?
assert(val++ != 0);
Answer / susie
Answer : & Explanation:
Assert macro is used for debugging and removed in release
version. In assert, the experssion involves side-effects. So
the behavior of the code becomes different in case of debug
version and the release version thus leading to a subtle bug.
Rule to Remember:
Don’t use expressions that have side-effects in assert
statements.
Is This Answer Correct ? | 2 Yes | 0 No |
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
How we will connect multiple client ? (without using fork,thread)
Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).
13 Answers Intel, Microsoft, TCS,
Cau u say the output....?
prog. to produce 1 2 3 4 5 6 7 8 9 10
int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }
Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.
void ( * abc( int, void ( *def) () ) ) ();
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??
main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }