c与c++ static
#include <stdio.h>
int main()
{
int x = 10;
static int y = x;
if(x == y)
printf("Equal");
else if(x > y)
printf("Greater");
else
printf("Less");
return 0;
}
In C, static variables can only be initialized using constant literals. This is allowed in C++ though

浙公网安备 33010602011771号