title: C program, that prints its executable file name
body: <p>Suppose source code file name is <code>test.cpp</code>. When it is compiled, it produce <code>test.exe</code> file. When I execute it, it should identify its file name that is <code>test.exe</code> and print it.</p>
  
  <p>I'm able to get list of all the files and directories present in the current directory using following code:</p>
  
  <pre><code>DIR * directory;
  struct dirent * direct;
  direct = readdir(directory);
  </code></pre>
  
  <p>But, how can I identify the associated file name, in this case which is <code>"test.exe"</code>?</p>