�가지.
ì„ ì–¸ì�„ 블ë¡�ì�˜ 앞ì�´ 아니ë�¼ 중간ì—�ë�„ ì„ ì–¸ 가능.
ë°°ì—´ì�„ ë�™ì �으로 ì €ë ‡ê²Œ í• ë‹¹í•˜ë‹¤ë‹ˆ -_-...
함수내ì—�서 함수 ì„ ì–¸ 가능.
ì„ ì–¸ì�„ 블ë¡�ì�˜ 앞ì�´ 아니ë�¼ 중간ì—�ë�„ ì„ ì–¸ 가능.
ë°°ì—´ì�„ ë�™ì �으로 ì €ë ‡ê²Œ í• ë‹¹í•˜ë‹¤ë‹ˆ -_-...
함수내ì—�서 함수 ì„ ì–¸ 가능.
#include <stdio.h>
int main()
{
int n;
printf("Array Size? ");
scanf("%d", &n);
int x[n];
int i;
for (i = 0; i < n; i++) {
x[i] = i * 10;
printf("%d ", x[i]);
}
printf("\n");
return 0;
}
- í� ì�´ìƒ�하네 ã…¡.ã…¡;; gccì—�서는 ë�˜ê³ , VS.netì—�서는 ì—�러를;; 잘못 컴파ì�¼ 한건가? 혹시 VS.netì—�서는 안ë�˜ë‚˜ìš”? - eternalbleu
- í��ì�Œ... Cì—�서 ë�™ì �í• ë‹¹ì�„ 하기 위해서는 new나 malloc ì •ë�„ì�˜ 키워드를 사용해야 하지 않나요?? 혹시.. 컴파ì�¼ 옵션ì�„ 달리해야 하는??;; - ì�´ìŠ¹í•œ
- 알아본 ê²°ê³¼ C99ì—�서 ì§€ì›�ë�˜ëŠ” 것으로 표준ì�´ 맞으며, 단지 VSì�˜ 컴파ì�¼ëŸ¬ê°€ C99를 ì™„ì „ížˆ 만족시키지 않기 때문ì�´ë�¼ê³ 함. gccë�„ 3.0 ì�´í›„ë²„ì „ë¶€í„° ì§€ì›�ë�œ 기능으로 variable-length array ì�´ë�¼ê³ 부르는군요. (gcc는 C99발표ì�´ì „부터 extension ì�˜ 형태로 ì§€ì›�ì�„ 하기는 í–ˆë‹¤ê³ í•©ë‹ˆë‹¤.) - eternalbleu
Open source development using C99
The new variable-length array (VLA) feature is partially available. Simple VLAs will work. However, this is a pure coincidence; in fact, GNU C has its own variable-length array support. As a result, while simple code using variable-length arrays will work, a lot of code will run into the differences between the older GNU C support for VLAs and the C99 definition. Declare arrays whose length is a local variable, but don't try to go much further.









