Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

file is good in c++

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>                       
#include <fstream>                        
using namespace std;
int main() {
    fstream FileName;                   
    FileName.open("FileName.txt", ios::in);         
    if (!FileName) {                        
        cout<<"File doesn’t exist";           
    }
    else {
        cout<<"File opened successfully";         
        }
    }
    FileName.close();                   
    return 0;
}
Source by www.mygreatlearning.com #
 
PREVIOUS NEXT
Tagged: #file #good
ADD COMMENT
Topic
Name
3+8 =