title: C or C++. How to compare two strings given char * pointers?
body: <p>I am sorting my array of car two ways. one by year which is shown below. and another one by make. Make is a char*   How do I compare strings when I just have pointers to them?</p>
  
  <pre><code>int i, j;
  for(i=0; i&lt;100; i++){
      for(j=0; j&lt;100-i; j++){
          if(carArray[i]!=NULL &amp;&amp; carArray[j]!= NULL &amp;&amp; carArray[j+1]!=NULL){
              if(carArray[i]-&gt;year &gt; carArray[j+1]-&gt;year){
                  swap(carArray[j], carArray[j+1]);
              }
          }
      }
  }
  </code></pre>
  
  <p>The above method works for int's (year). How can I make it work for char pointers?</p>