title: How to create an empty file in linux using c++
body: <p>I want to create an empty file in ubuntu with c++ and i tried many ways and it keeps failing and show this error </p>
  
  <blockquote>
    <p>error: no matching function to 'std::basic_ofstream::open(std::cxxll::...</p>
  </blockquote>
  
  <p>my code:</p>
  
  <pre><code>ifstream f(saltFile.c_str());
  
  if (f.good())
  {
       cout &lt;&lt; saltFile + " file already existed" &lt;&lt; endl;
  }
  else
  {
      ofstream file;
      file.open (saltFile, ios::out);
      cout &lt;&lt; saltFile &lt;&lt; " created!" &lt;&lt; endl;
  }
  </code></pre>