#include <stdio.h>
/* global variable declaration */
int g = 20;
int main()
{
/* local variable declaration */
int g = 10;
printf ("value of g = %d %d\n", g,::g);
return 0;
}
當我試圖運行此程序。這是投擲錯誤main.c:11:39: error: expected expression before ':' token printf ("value of g = %d %d\n", g,::g);
。但是,如果它是用C++編寫的,它工作正常。C支持範圍解析嗎?
沒有,C沒有任何關係如C++範圍界定操作符。 –