struct {
char* engine;
}car1,car2;
int main(void) {
car1.engine = "engine a";
car2.engine = "engine 2";
}
I'm learning thru a video on youtube about structs, and I tried running this code which was shown as an example. But VS would give me an error saying "a value of type 'const char*' cannot be assigned to an entity of type'char*'." I don't know why this happens. It would run flawlessly in the video. For one thing, my Vs is a cpp file. But isnt c code supposed to work in c++?