code.club

標題: 有關of無法宣告變數放在變數裡的情形 [打印本頁]

作者: return    時間: 2015-12-29 16:06
標題: 有關of無法宣告變數放在變數裡的情形
例如

int x = 10;
int arr[x];

這是不被允許的,只能用 #define x 10
int arr[x];

但在 C++裡,int x=10; arr[x]; 是可以的。

而processing則是 int x = 10;
int[] arr = new int[x];
也是可以的。




歡迎光臨 code.club (http://code.club/) Powered by Discuz! X3.2