2d array, using calloc in C

后端 未结 4 1264
长情又很酷
长情又很酷 2021-01-28 17:54

I\'m trying to create a 2D array of chars to storage lines of chars. For Example:

lines[0]=\"Hello\";
lines[1]=\"Your Back\";
lines[2]=\"Bye\";

4条回答
  •  悲哀的现实
    2021-01-28 18:18

    Here i'm opinion is different. May be useful. char pointer or char double is implicitly define during compilation. Hence it is not need to define explicitly and by doing so it show syntax error. Try char pointer without initializing by calloc and if you don't want garbage value initialize with NULL. It act like using calloc, you find nothing different.

提交回复
热议问题