#include <iostream> #include <fstream> int main() { const char* filename = "example.txt"; std::ifstream file(filename); if (file) { std::cout << "File exists." << std::endl; } else { std::cout << "File does not exist." << std::endl; } return 0; }