我正在使用 winpmem 创建内存映像。我想创建一个界面,允许用户搜索图像中的各种模式。我正在使用 C++ 打开和读取文件,但我无法将内容转储到标准输出。我尝试将各种数据类型用于流式传输到标准输出的变量声明,但我无法将文本表示转储到屏幕上。这是我的代码:
包括“stdafx.h”
包括“iostream”
包括“iomanip”
包括“fstream”
使用命名空间标准;
int _tmain(int argc, _TCHAR* argv[])
{
双x;
int i = 0;
ifstream test;
test.open("C:\\Temp\\mem.raw");
if (!test){
cerr << "Unable to open file datafile.txt";
exit(1); // call system to stop
}
while (test >> x) {
cout << i;
cout << ":";
cout << x;
cout << ",";
i++;
}
test.close();
return 0;
}