The output of the following program:
Will be the same memory address printed twice. In other words, you could do (if "test"=="test") and you would get a true as result.Code:int main(){ int x = "test"; int y = "test"; printf("%u %u\n",x,y); return 0; }
Does this mean that whenever you invoke a string literal the program will check if the same string has been stored previously, and in positive case it will just return a pointer to that same string instead of allocating memory for a new one?