title: How can I check the file extensions in c?
body: <p>I'm struggling with this for several days now. </p>
  
  <p>I want to create a functions that goes through a directory, pick all the files with an extension *.csv and read the data in them. </p>
  
  <p>I created a function that is supposed to check each file name that is legal, by checking that the string ends with .csv. To do this, I want to go to the end of the char * array. I tried this:</p>
  
  <pre><code> char * point = file_name;
   while (point != "\0"){
      point += 1;
   }
  </code></pre>
  
  <p>which goes through the char * array without finding and "\0".</p>
  
  <p>If I write </p>
  
  <pre><code>*point != "\0"
  </code></pre>
  
  <p>The compiler warns me that I'm comparing and int to a char.</p>
  
  <p>I should note that I get the filename using </p>
  
  <pre><code> dirent-&gt;d_name
  </code></pre>