class GroceryItem {
private:
/* … */
public:
/* … */
// operator overloadings
friend istream& operator>> (istream& is, GroceryItem* item);
friend ostream& operator<< (ostream& os, GroceryItem* item);
};
istream& operator>> (istream& is, GroceryItem* item) {
is >> item->_brandName >>item->_productName;
return is;
}
ostream& operator<< (ostream& os, GroceryItem* item) {
os << "\nBrand "<< item->_brandName << " product " << item->_productName;
return os;
}
int main()
{
// declare vector of items
std::vector<GroceryItem*> items;
//GroceryItem1
GroceryItem* item1 = new GroceryItem();
std::cin >> item1;
items.push_back(item1);
//GroceryItem2
GroceryItem* item2 = new GroceryItem();
std::cin >> item2;
items.push_back(item2);
//print and delete all pointers to avoid memory leak
for (auto p : items) {
std::cout << p;
delete p;
}
return 0;
}
我跑了ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.txt'
,得到了以下内容:
pip install --up
答案 0 :(得分:0)
通过运行pip install -r requirements.txt
,您会指示pip安装路径为requirements.txt
的文件中列出的软件包。确保执行Requirements File Format之后的执行文件夹(requirements.txt
中有一个名为C:\Users\evaim
的文件。