What is the functional difference between these two declarations: char * string1="string"; char string2[]="string";
Anonymous
string1 is just a string literal that is allocated as read only, so it can't be changed. string2 is just an allocated array of characters, that can be changed. This only holds true for char * . Compiler magic at its finest.
Check out your Company Bowl for anonymous work chats.