fork download
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. bool ArqExiste(string Arquivo) {
  6. ifstream verificacao (Arquivo.c_str());
  7. if (verificacao.is_open()) {
  8. verificacao.close();
  9. return true;
  10. } else {
  11. verificacao.close();
  12. return false;
  13. }
  14. }
  15.  
  16. int main() {
  17. string file = "C:\\Temp\\aipflib.log";
  18. printf("%b", ArqExiste(file));
  19. }
  20.  
  21. //https://pt.stackoverflow.com/q/73698/101
Success #stdin #stdout 0s 4348KB
stdin
Standard input is empty
stdout
%b