README.md
December 4, 2022 ยท View on GitHub
Description
This function will check to see if a file exist in the computer if it doesnt it will return -1 else 0.
More Info
| Submitted On | |
| By | Josh Nixon |
| Level | Beginner |
| User Rating | 3.4 (81 globes from 24 users) |
| Compatibility | C, C++ (general), Microsoft Visual C++, Borland C++, UNIX C++ |
| Category | Algorithms |
| World | C / C++ |
| Archive File |
API Declarations
#include <fstream.h>
Source Code
int Check_File(char *FileName)
{
ifstream FileL;
FileL.open(FileName);
if(!FileL)
{
FileL.close();
return -1;
}
else
{
FileL.close();
return 0;
}
}