Vlatko
Oct 4th, 2000, 01:50 PM
I am using this simple routine to copy a file.I use MFC(e1 is a variable for the EDIT control of type CString).I get a error because the compiler can not convert from string to CString.How to solve this?
#include <string>
#include <fstream>
#include <iostream>
using namespace std;
string got,all;;
ifstream in("readme.txt");
ofstream out("copy.txt");
while(getline(in,got))
out<<got<<"\n";
all += got;
e1 =all;
UpdateData(false);
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptable
#include <string>
#include <fstream>
#include <iostream>
using namespace std;
string got,all;;
ifstream in("readme.txt");
ofstream out("copy.txt");
while(getline(in,got))
out<<got<<"\n";
all += got;
e1 =all;
UpdateData(false);
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no acceptable