Heim > Fragen und Antworten > Hauptteil
PHP中文网2017-04-17 13:56:38
既然用C++了不如上点C++的用法吧
#include <string>
#include <fstream>
#include <sstream>
using namespace std;
using std::string;
int main() {
std::ifstream t(__FILE__);
std::stringstream sb;
sb << t.rdbuf();
printf("%s\n", string(sb.str()).c_str());
return 0;
}