Hi,
how to convert it?
char buffer[1024];
fgets (buffer, sizeof(buffer), fp)
// convert buffer to c++ STL string
This is a discussion on char[1024] to c++ STL string within the C++ Programming forums, part of the General Programming Boards category; Hi, how to convert it? char buffer[1024]; fgets (buffer, sizeof(buffer), fp) // convert buffer to c++ STL string...
Hi,
how to convert it?
char buffer[1024];
fgets (buffer, sizeof(buffer), fp)
// convert buffer to c++ STL string
1st: you should use ifstream instead of fp;
2nd: you can convert like this:
str is which you need.Code:string str(buffer);
Hello, everyone.