Code:#include<stdio.h> main() { int i = 3,j; j = add(++i); printf("i = %d j = %d\n", i, j); } add(ii) int ii; { ii++; printf("ii = %d\n", ii); }
Code:#include<stdio.h> main() { int i = 3,j; j = add(++i); printf("i = %d j = %d\n", i, j); } add(ii) int ii; { ii++; printf("ii = %d\n", ii); }
No cookie for you until you tell us where you got this from and why you want to know the answer when you have not made any effort to figure it out yourself.
If you are getting this from some book, then throw the book away (or return it to the library). If you are getting this from some website, then close any browser windows/tabs that has that website opened, remove it from your bookmarks, and clear your history and cache. Then forget about that website. If you wrote the program yourself... you need to unlearn what you have learned.
Last edited by laserlight; 09-03-2010 at 05:15 AM.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
i suggest that if you are using a book/Internet, take a paper and write down the code...then slowly line after line you should be able to understand this...it is boring...but it is a method!
THAT code is old!
Code:add(ii)int ii;
what is the program output please explain
Continuing with the homework dump and 0% effort I see.
Soon, I will lock them on sight.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.