+ 1
char *array[] is an array of char pointers. Strings are char pointers. So you can assign an array of strings to a variable declared as an array of char pointers. string *array[] is an array of string *pointers*, not of strings. So it throws the error.
26th May 2022, 12:18 PM
Emerson Prado
Emerson Prado - avatar
+ 1
Manav Roy why is it that you always do things the hard way?😅 The sane thing to do when in c++ is to keep away from pointers and c-style strings. why do you keep inflicting pain on yourself? 😁I think you do this for fun... https://embeddedartistry.com/blog/2017/07/26/stdstring-vs-c-strings/
26th May 2022, 2:36 PM
Bob_Li
Bob_Li - avatar