就是把用户的输入存到数组里

解决方案 »

  1.   

    char a[20];
    char *s = "hello";
    strcpy(a, s);The strcpy function copies strSource, including the terminating null character, to the location specified by strDestination. No overflow checking is performed when strings are copied or appended. The behavior of strcpy is undefined if the source and destination strings overlap.
    你要注意分配足够的数组大小, 否则会导致程序溢出的.
      

  2.   

    用库函数计算字符串长度,返回的应该是个int值。利用这个int值动态创建数组就可以了。