Hello,
I am having a problem to call a function
I am posting the code...
Can anyone help how we can solve the problem...

int AES(string path1, string path2)
{
        ifstream myfile1 (path1, ios::binary);// error
	ofstream myfile3  (path2, ios::binary);//error
}

int main()
{
    AES( "c:/plaintext.txt" , "c:/cipheretxt.txt" );
    return 0;
}

The filename parameter has to be a C-style string:

ifstream myfile1 (path1.c_str(), ios::binary);
ofstream myfile3  (path2.c_str(), ios::binary);
commented: Very Helpful +1

fstream parameters require const char*, not string. So pass the c_str() method ifstream myfile1 (path1.c_str(), ios::binary) [edit]^^^ what Narue said.[/edit]

Thanks Ancient Dragon and Narue...
Thats solved the problem..
You people are very helpful keep the thread going on...Good luck..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.