我正在嘗試編寫一個函數,該函數從listAccounts中刪除向量元素,具體取決於該向量元素的account_name。我寫了這個: void Account::remove_account(string name) {
auto iter = listAccounts.begin();
for (; iter != listAccounts.end(); iter++)
我是C++新手。我有這個代碼: int main()
{
vector<int> a = { 1,2,3,4,5,6 };
vector<int> b(&a[0], &a[5]); // what's wrong? Is it completely wrong this way?
for (int i = 0; i < 6; i++) {
cout