title: error: Iso c++ forbids comparison between pointer and integer [c++], splitting sentence into words
body: <p>I am trying to split the sentence into words by checking the characters from the string one by one.</p>
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      string a;
      getline(cin,a);
      string word = &quot;&quot;;
      for(int i=0;i=a.size();i++)
      {
          if(a[i]==&quot; &quot;) //error iso here
          {
              cout&lt;&lt;word&lt;&lt;endl;
              word=&quot;&quot;;
          }
          else
          {
              word+=a[i];
          }
          cout&lt;&lt;word&lt;&lt;endl;
      }
  
  }
  </code></pre>