<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/platform.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d6460305619331450763\x26blogName\x3dCache+Your+Cash\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dSILVER\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://cacheyourcash.blogspot.com/search\x26blogLocale\x3den_US\x26v\x3d2\x26homepageUrl\x3dhttp://cacheyourcash.blogspot.com/\x26vt\x3d5601808346138360992', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Cache Your Cash


Francais | Espanol | Deutsche | Italiano | 中文 | 한국어 | 日本語 |

C++ Trivia

Friday, April 6, 2007


Can some one tell the output using different compiler (especially VC++) and explain the reasoning too?

5 points to you if you find the correct answer in first go.


-----------------------------------------------------------


#include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[])
{
int Buffer[16];
int i = 10;

switch (i)
{
case 9:
int Buffer[8];
break;

case 10:

printf("The number of elements in buffer is %d",s izeof(Buffer)/sizeof(int));

getchar();
break;
}
return 0;
}

----------------------------------------------------------------------

Labels: ,


Digg | delicious | Spurl | redit
posted by cacheyourcash, 1:44 PM

0 Comments:

Add a comment