正在加载图片...
A somewhat more complex instance of a dangling reference occurs if a local function can be returned by a all Typedef int(* proc)(void) Proc g(int x) fint f( void)/*illegal local function*/ freturn x; return f; mair proc C, g(2); printf( % dn, cO); /*should print 2*/ return 0• A somewhat more complex instance of a dangling reference occurs if a local function can be returned by a call Typedef int(* proc)(void); Proc g(int x) {int f(void) /*illegal local function*/ {return x;} return f;} main() { proc c; c= g(2); printf(“%d\n ”,c());/* should print 2*/ return 0; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有