Skip to content

Instantly share code, notes, and snippets.

@ikbear
Created December 14, 2010 15:04
Show Gist options
  • Save ikbear/740545 to your computer and use it in GitHub Desktop.
Save ikbear/740545 to your computer and use it in GitHub Desktop.
VC 6.0 Bug
#include <iostream>
using namespace std;
void fun(int i)
{
static int n = i ;
int *p = &n ;
cout << n << endl ;
++n ;
--p ;
*p = 0 ;
}
int main(void)
{
for (int i(10); i > 0; --i)
{
fun(i) ;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment