#include <iostream>
#include <fstream>
int main(){
std::string path = "data.txt";
ifstream file(path);
if(file.is_open()){
std::cout << "File is open"<< std::endl;
} else std::cout << "File did not open" << std::endl;
return 0;
}
Code Example |
---|
Cpp :: for loop in c++ |
Cpp :: sieve of eratosthenes algorithm in c++ |
Cpp :: c++ find_if |
Cpp :: c++ get environment variable |
Cpp :: vector search by element |
Cpp :: C++ press enter to continue function |
Cpp :: why are inline keyword in header c++ |
Cpp :: splice string in c++ |
Cpp :: how to get the first element of a map in c++ |
Cpp :: count bits c++ |
Cpp :: 1d array |
Cpp :: comparator for priority queue c++ |
Cpp :: swapping of two numbers |
Cpp :: hello world program in c++ |
Cpp :: vector length c++ |
Cpp :: find index of element in array c++ |
Cpp :: print a string with printf in c++ |
Cpp :: who to include a library c++ |
Cpp :: c++ int to char* |
Cpp :: Reverse Level Order Traversal cpp |
Cpp :: c++ min int |
Cpp :: function in c++ |
Cpp :: new float array c++ |
Cpp :: remove first occurrence of value from vector c++ |
Cpp :: intersection.cpp |
Cpp :: c plus plus |
Cpp :: find in unordered_map c++ |
Cpp :: cpp define |
Cpp :: check even or odd c++ |
Cpp :: c++ changing string to double |