title: How to loop through a string by space? How do i know the index no of the word i currently am on in the string?
body: <p>This code that i have written loops through a string char by char. What i want is to loop through a string word by word. Here is my code.</p>
  
  <pre><code>string a; // already declared
     // c is string array
  for (i=0;i&lt;b;i++) {
      if (strcmp (c[i],a[i]) == 0 ) {
        // do something
         }
       }
  </code></pre>