This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes C / C++ and the fly likes Simple C program-please explain output. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » C / C++
Bookmark "Simple C program-please explain output." Watch "Simple C program-please explain output." New topic
Author

Simple C program-please explain output.

hitesh inception
Greenhorn

Joined: Sep 13, 2012
Posts: 1


output: 20

I could not understand why it prints '20' ? please explain it !
Anand Hariharan
Rancher

Joined: Aug 22, 2006
Posts: 257

Do not try to understand code that is meaningless and/or has undefined behaviour.

Look up http://www.c-faq.com -- Section 3. All of it would make good reading, but 3.8, 3.2 and 3.11 would probably be the most relevant for you.

There is a (very) brief explanation by Stroustrup at http://www.stroustrup.com/bs_faq2.html#evaluation-order

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple C program-please explain output.
 
Similar Threads
char variable
Confusion about indexOf method
getInt()
Javabeat query
synchronisation