README.md

December 4, 2022 ยท View on GitHub

[\File Exist Algorithms/]

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
ByJosh Nixon
LevelBeginner
User Rating3.4 (81 globes from 24 users)
CompatibilityC, C++ (general), Microsoft Visual C++, Borland C++, UNIX C++
CategoryAlgorithms
WorldC / 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;
  }
}