Curly-Brace Block Scope

I am trying to use a curly brace block to limit the scope of some functions, but VC++ is giving me the error:
'{' : missing function header (old-style formal list?)

I even tried something as simple as
{ int i = 0; }
and it still returned that error.
What am I doing wrong?
post your code using the [code] tags and we can tell you.
did you put that line outside a function?
you shouldn't.
int main(){
{int i = 0;}
return 0;
}
works fine.
Thank you, that was the problem, I had it by itself in a header file.
Topic archived. No new replies allowed.