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 |
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.
16 Answers Aricent, Cisco, Directi, Qualcomm,
create a login program that ask username and password. if you input username or password 3 times wrong, the program will terminate else the program will prompt a message "congratulations"
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
how can i cast a char type array to an int type array
What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?
#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }
How to return multiple values from a function?
void main() { int const * p=5; printf("%d",++(*p)); }
3 Answers Infosys, Made Easy, State Bank Of India SBI,
main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", x--); } } a. 4, 3, 2, 1, 0 b. 1, 2, 3, 4, 5 c. 0, 1, 2, 3, 4 d. none of the above
main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
main() { char a[4]="HELL"; printf("%s",a); }
how to return a multiple value from a function?