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 output of printf("%d")?

Answer Posted / arvind kumar yadav

When we use %d the compiler internally uses it to access
the argument in the stack (argument stack). Ideally
compiler determines the offset of the data variable
depending on the format specification string. Now when we
write printf("%d",a) then compiler first accesses the top
most element in the argument stack of the printf which is %
d and depending on the format string it calculated to
offset to the actual data variable in the memory which is
to be printed. Now when only %d will be present in the
printf then compiler will calculate the correct offset
(which will be the offset to access the integer variable)
but as the actual data object is to be printed is not
present at that memory location so it will print what ever
will be the contents of that memory location.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

1098


What is difference between rand () and srand ()?

1045


What is set in c++?

1079


what you know about c++?

1099


What is recursion?

1952


What is the basic concept of c++?

966


How can I learn c++ easily?

1023


What is size of string in c++?

937


What apps are written in c++?

1039


What does the nocreate and noreplace flag ensure when they are used for opening a file?

1065


What is the identity function in c++? How is it useful?

1001


What does asterisk mean in c++?

1074


What is the history of c++?

1008


How would you use the functions randomize() and random()?

1030


What is difference between malloc()/free() and new/delete?

1122