Split a sentence into an array of string without knowing the size : 1.How to Split a sentence into an array of string[words] when i am taking the sentence from the user and i don't know the number of words in the sentence.

Example-

Sentence:"why are you here?"

str[0]="why"

str[1]="are"

str[2]="you"

str[3]="here?"

2.How to compare "here" and "here?" ?