title: Why is the counter value not incrementing?
body: <p>The counter does not increase at all so I want to know which part went wrong.</p>
  <pre><code>#include &lt;cstring&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  
              
  int main(){
     int total=0,na=0,ni=0;//use to count how much type of element is there
     string chem;
     getline(cin,chem);
  
     for(int i=0;i!='\0';i++){
         if(chem[i]=='N'){
             if(chem[i+1]=='i'){
                 ni++;
             }else{
                na++;
                cout&lt;&lt;na&lt;&lt;endl;
          }
      }
  }
  </code></pre>
  <p><em>na and total values are both 0</em></p>
  <pre><code>cout&lt;&lt;na&lt;&lt;endl;
  total=total + ni+na;
  cout&lt;&lt;total;
  </code></pre>