i find a solution. use a global ptr . use a marcro to invoke obj's method.
like this:
void * this_g= NULL;
#define tzw_invoke(obj,meth) this_g = obj; obj-> meth

and in called func,we should make sure the"this"'type is what.
place the following command in the top of function 's body;
#define set_this(tzw_type) void * this =(tzw_type *) this_g

example:
set the struct type is "chinese", it's obj is tangziwen(my name~~),one of the methods is say_hello
like this:
void say_hello(var num)
{
set_this(chinese);
......
printf("ni-hao!");
this.stuff=num;
......
}
int main(void)
{
tzw_invoke(tangziwen,say_hello)(5);
........
return 0;
}

well,the syntax is a bit ugly. but work fine.

Last edited by tzw; 04/29/11 05:16.

Full of my eyes are class struggles.....