title: Open file in C linux
body: <p>I am using C to open a file for reading. I have this code : </p>
  
  <pre><code>fp = fopen("./settings.cfg","r");
  if (fp != NULL)
      printf("OK");
  else
      printf("ERROR");
  </code></pre>
  
  <p>but I always get an error.</p>
  
  <p>The file is located in the folder where the executable resides. I have tried writing only "settings.cfg". What might be the problem?</p>