segmentation error happend. I check the code for long time then I find the clue. need to check the scope of local variable.
void main()
{
parseoption po();
{
int a;
po.register(&a)
}
some code maybe access to &a using po
}
in above case, when local variable a is deleted in stack? I think a only live in block { } but someone said local variable live in function, not block { }
when I remove the block of int a, no segmentation error happened. so I think int a only live in { }. Am I right??