A little confused about how strigns work!
I know that a string is basically a pointer to the first character, and the next memory adresses will contain the next characters until the \n indicates the end of the string. But do we need to allocate it? the string is just in the memory and it can easily be overwritten right? So I believe that this is how C works: if you define the array with size 5 than compiler allocates suitable amount of memory for it, otherwise if we want a pointer - than how does a compiler know the amount of memory requested? It will probably allocate the the minimum - 1 byte?...
Thank you very much!