#include "stdio.h"
typedef struct s
{
int a;
char b;
~s(){a=0;b=0;}
}s;
#if 1
struct s* bi(struct s& d)
{
d.a=100;
d.b='a';
return &d;
}
#else
struct s* bi(struct s d)
{
d.a=100;
d.b='a';
return &d;
}
#endif
int main()
{
struct s *p;
struct s sk;
sk.a=155,sk.b='z';
printf("%d,%c\n",sk.a,sk.b);
p=bi(sk);
printf("%d,%c\n",p->a,p->b);//这个结果为什么 100 a
return 0;
}
尝试一下语法加亮……成功……
[[it] 本帖最后由 StarWing83 于 2008-4-20 16:34 编辑 [/it]]