我正在使用 C++,我正在从这样的文件行中读取:
D x1 x2 x3 y1
我的代码有:
struct gate {
char name;
vector <string> inputs;
string output;
};
在main
函数中:
vector <gate> eco;
int c=0;
int n=0;
int x = line.length();
while(netlist[c][0])
{
eco.push_back(gate());
eco[n].name = netlist[c][0];
eco[n].output[0] = netlist[c][x-2];
eco[n].output[1] = netlist[c][x-1];
}
netlist
我已将文件复制到的二维数组在哪里。
我需要帮助来循环输入并将它们保存在 vector 中eco
。