http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_programming&no=6540 []
char *p1[12]; char 12¥ 迭 ̰
char *p=(char*)malloc(sizeof(char)*12); char 12¥ 迭 Ҵ Դϴ. Ÿ ٸ Դϴ.
===============================================================================
>#include <stdio.h>
>#include <stdlib.h>
>#include <string.h>
>
>main()
>{
> char *p1[12]; // 迭 p1
> char *p=(char*)malloc(sizeof(char)*12);// p
>
>
> strcpy(p1,"haaaaa"); // <- κп ϴ.
> strcpy(p,"hohoho");
>}
>
>
> P1 P Ŷ ߴµ
> VC غ Ʒ ߴ
>
>warning C4047: 'Լ' : 'char *' 'char *[12]'() ٸϴ.
>warning C4024: 'strcpy' : Ű 1 ٸϴ.
>
>Q. ̷ ٴ P1 P ٸٴ ǵ ٸ
> ˰ ͽϴ.
>
>
>
>
=============================================================================== |
Hit : 3179 Date : 2015/06/28 04:25
|