Sobsna, as far as I understood, I cannot change a string if I initialized a pointer to it, for example, char* a("dududu"); (an exception is thrown with an access error while writing, for example, *p = 'a'; ). But I can create an array of characters: char a[]("dududu") , but I do not understand how to bring it into dynamic memory through new. The editor writes:
An aggregate object requires initialization using "{...}"
What does this mean (how to fix it) or how else can I change the string?
Exception code:
char* a("dududu"); char* p(a); *p = 'a';
char* a("dududu");is not valid, since in C ++ it is forbidden to implicitly cast an array ofchar constto a pointer to achar, this is apparently your gcc extension. - VTT