📜  在向量 cpp 中存储文件 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:45.731000             🧑  作者: Mango

代码示例1
#include 
#include 
using namespace std; 
int main() 
{ 
    ifstream file; 
    string inputString; 
    vector data; 
    file.open("/path/to/file"); 
    while(file>>inputString) //reads one string at a time 
        data.push_back(inputString); //add it to data vector 
    file.close(); 
}