char array not assignable

后端 未结 4 1079
陌清茗
陌清茗 2020-12-19 17:26

Okay, so I want to save a word in a char array but it gives me a error

Here\'s my code

#include 
#include  
#i         


        
4条回答
  •  甜味超标
    2020-12-19 18:05

     class = "Ranger";
    

    should be

    strcpy(class,"Ranger");
    

    Fix the same in all the places. char arrays are not assignable

提交回复
热议问题