assigning a string to another string

后端 未结 5 1010
没有蜡笔的小新
没有蜡笔的小新 2021-01-28 09:11

Why this code is not running? Why str1 is not assigned to str2 ?? I know i have an option of using strcpy but i wish to know the reason why this is not working??



        
5条回答
  •  花落未央
    2021-01-28 09:39

    str2 and str1 refers to the address of their first elments so assignment of arrays is not done in this way use either str[] to assign char by char or use inbuilt strcpy

提交回复
热议问题