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 -
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 -
C++ 2022-01-22 18:06:45
skip headers while reading text
#include<sstream> ... ... std::ifstream file {"test.txt"}; std::string word, line; std::istringstream iss; double var, tab[100][6]; int i=0, j; ... while(getline(file, line)) { if (!(line[0]=='#')) { iss.str(line); j = 0... 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 -
C++ 2021-11-23 05:29:38
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