69,369
社区成员
发帖
与我相关
我的任务
分享
# include <stdio.h>
struct stg {int x; char a [32];};
struct stg f (void)
{
struct stg m;
/* …… */
return m;
}
int main (void)
{
printf (f ().a); //Well defined behavior.
printf ("%x", ++ (f ().a [0])); //Undefined behavior.
}
int x;
struct t {int i;} t;
int f (void)
{
int y;
int a [22];
static int * p0 = & x; //合法。
static int * p1 = & t.i; //合法。
static int * p2 = & y; //非法。
static int * p3 = & a [0]; //非法。
}