Difference between using character pointers and character arrays

前端 未结 9 1130
不思量自难忘°
不思量自难忘° 2020-11-29 03:45

Basic question.

char new_str[]=\"\";

char * newstr;

If I have to concatenate some data into it or use string functions like strcat/substr/

9条回答
  •  爱一瞬间的悲伤
    2020-11-29 04:25

    The difference is that one is a pointer, the other is an array. You can, for instance, sizeof() array. You may be interested in peeking here

提交回复
热议问题