i want to load txt file, but the name of txt file is variale. please hepl me!!!
my code is error!!!
String ^ s;
s="t";
ifstream txt (s+".txt");///error
im a beginers!!
thanks
Last edited on
1 2 3 4 5 6 7 8 9
|
#include <string>
#include <fstream>
int main()
{
std::string s = "t";
std::ifstream txt(s + ".txt"); // modern compiler
// std::ifstream txt( (s + ".txt").c_str() ); // old compiler
}
|
Last edited on