Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the hidden bug with the following statement?

assert(val++ != 0);



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

Post New Answer

More C Code Interview Questions

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"

2 Answers  


main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }

2 Answers   Wipro,


how can i cast a char type array to an int type array

2 Answers  


What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

1 Answers  


#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }

3 Answers  


How to return multiple values from a function?

7 Answers  


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

3 Answers   HCL,


main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

2 Answers  


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


how to return a multiple value from a function?

5 Answers   Wipro,


Categories