I'm having trouble dealing with string
.
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;
bool ArqExiste(string Arquivo)
{
ifstream verificacao (Arquivo.c_str());
if(verificacao.is_open())
{
verificacao.close();
return true;
}
else
{
verificacao.close();
return false;
}
}
int main()
{
string file = "C:\Temp\aipflib.log";
printf("%b", ArqExiste(file));
}
At line ifstream verificacao (Arquivo.c_str())
, gave the error:
variable 'std :: ifstream verification' has initializer but incomplete type
I use Codeblocks to program.