Way to store and manipulate string in C programming - Searching and counting target in string