A
A
Here is an example function:
void MyFunction()
{
struct TLocal
{
static bool Check(int i)
{
return true;
}
};
TLocal::Check(1);
}
This is how I call local function "Check". This function should have scope
only within MyFunction as far as I know and lose scope once MyFunction is
done. Is this true?
If I remove "static" then TLocal::Check(1); call will not work - can anyone
explain why?
Also, is there any other (better in some way or easier in some way) method
to call local functions? Would it make some difference if I used "class"
instead of "struct"?
void MyFunction()
{
struct TLocal
{
static bool Check(int i)
{
return true;
}
};
TLocal::Check(1);
}
This is how I call local function "Check". This function should have scope
only within MyFunction as far as I know and lose scope once MyFunction is
done. Is this true?
If I remove "static" then TLocal::Check(1); call will not work - can anyone
explain why?
Also, is there any other (better in some way or easier in some way) method
to call local functions? Would it make some difference if I used "class"
instead of "struct"?