The first statement puts the literal string “mycplus” in read-only memory and copies the string to newly allocated memory on the stack. The second statement is known as static string allocation and definition. This statement places the string “mycplus” in the read-only parts of the memory and making p_name a pointer to that string.
This is a sample Java program to demonstrate string sorting. The function uses a space character as a separator between words. It iterates through each word in the input string and creates a words array. Finally it sorts the array of the words in ascending order of the letters i.e. a->z and displays the sorted array by printing one word at each line.