title: is this how i check a file extension in a specifc text file?
body: <p>Hello I'm trying to implement a way too check a file extension in a specific text file the code below doesn't seem to do what I want but I was wondering if this is somewhat the right direction to take in doing this. if not what library are there that would allow me to do this in as less code as possible.</p>
  
  <pre><code>string fn = ".txt";
  if(fn.substr(fn.find_last_of(".") + 1) == ".txt") {
      fprintf(stderr,"yes");
  } else {
      fprintf(stderr,"no");
  }
  </code></pre>
  
  <p>im on windows 7 32bit</p>