Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

cpp ifstream

#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;
}
 
PREVIOUS NEXT
Tagged: #cpp #ifstream
ADD COMMENT
Topic
Name
2+7 =