What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-19 22:20:17
check file exist cpp
#include <sys/stat.h> #include <unistd.h> #include <string> #include <fstream> inline bool exists_test0 (const std::string& name) { ifstream f(name.c_str()); return f.good(); } inline bool exists_test1 (const std::str... Add solution -
C++ 2022-01-27 19:21:07
visual studio 2019 read and write text file c++
#include <iostream> #include <fstream> #include <string> using namespace std; int main(){ fstream newfile; newfile.open("tpoint.txt",ios::out); // open a file to perform write operation using file object if(newfile.is... Add solution -
Other 2022-01-24 05:20:37
PntIDNumbers
#include <iostream> #include <fstream> #include <cstdlib> #include <string> #include <sstream> #define MAX 200 using namespace std; // Function receive address of the first element of an array // Reads file contents and store... Add solution -
Other 2022-01-22 21:16:13
how to use flush in cpp
// Flushing files (flush manipulator) #include <ostream> // std::flush #include <fstream> // std::ofstream int main () { std::ofstream outfile ("test.txt"); for (int n=0; n<100; n++) outfile << n <<... Add solution -
C++ 2021-11-23 05:34:13
how to open an input file in c++
#include <fstream> ifstream file_variable; //ifstream is for input from plain text files file_variable.open("input.txt"); //open input.txt file_variable.close(); //close the file stream /* Manually closing a stream is only necessary if y... Add solution -
C++ 2021-11-23 05:32:14
how to open an input file in c++
#include <fstream> ifstream file_variable; //ifstream is for input from plain text files file_variable.open("input.txt"); //open input.txt file_variable.close(); //close the file stream /* Manually closing a stream is only necessary if y... Add solution