OK now I filaly get it. My stupid mistake that I thought that this is wrong because of the pointer to a constant string ( didn't know that that was legal).hello" is a string literal. It is constant and cannot be changed. Therefore, this second line of code is illegal:
const char* s = "hello";
I once had some problems in one test case ( don't remember anymore what it was ). In all the other test cases it worked so perhaps I made a mistake somewhere else back then.So I don't understand why you think that code "can create problems with the pointer". Can you elaborate?
I thouhth that the problem was caused because if you have a pointer of some length and then add aditional characters over the allocated size it could overwrite some other part of the memory that contains other data. Is that not so?