Check that file exists: Difference between revisions

m
Improved grammar in comments.
m (Adjusted text formatting issues.)
m (Improved grammar in comments.)
Line 967:
 
===Using C++ 17===
C++ 17 contains a Filesystem library which significantly improves manipulationsoperations with files.
<syntaxhighlight lang="c++">
 
Line 987:
 
int main() {
file_exists("C:/input.txt");
file_exists("C:/zero_length.txt");
file_exists("C:/docs/input2input.txt");
file_exists("C:/docs/zero_length2zero_length.txt");
}
</syntaxhighlight>
{{ out }}
</pre>
"C:/input.txt" exists with a file size of 11 bytes.
 
"C:/zero_length.txt" exists with a file size of 0 bytes.
 
"C:/docs/input2input.txt" exists with a file size of 11 bytes.
 
"C:/docs/zero_length2zero_length.txt" exists with a file size of 0 bytes.
</pre>
 
894

edits