您好我想使用 ifstream 读取散列值的 txt 文件并将值存储在数组中。
128 位散列字符串 另一个 128 位散列字符串等
这是我到目前为止所拥有的:
string line;
ifstream myfile ("username.txt");
vector<string> data_arr;
int i = 0;
if (myfile.is_open())
{
while (myfile.good())
{
getline(myfile, line);
data_arr.push_back(line);
i++;
}
myfile.close();
}
else cout << "Unable to open file";
我怎样才能使数组的每个值都是 16 字节长?我猜 getline 对我不起作用,因为散列值可能使换行标记成为字符的一部分。
无论如何,我希望这是有道理的,(可能不是)因为我是在凌晨 5 点输入的。