#include "stdafx.h"
#include <iostream>
using namespace std;
void func(void);
static int count = 10; /* Global variable */
int main() {
while(count--) {
func();
}
return 0;
}
// Function definition
void func( void ) {
static int i = 5; // local static variable
i++;
cout << "i is " << i ;
cout << " and count is " << count << endl;
}
can't seem to fix this, just learning and reading Storage class in tutorialspoint.com . is this Visual Studio issue? because the code is working on Code::Blocks