我想要構建一個銀行系統。它要求用戶創建最多10個帳戶對象,然後將它們插入到對象數組中。後來我需要提到某些對象數組中使用被稱爲對象以產生一個預測, 到目前爲止,這是我做了什麼比我上輸入什麼> 10如何檢查對象數組是否有用於我的學校項目的引用對象
cout << "\nHow many accounts do you wish to crate: \n";
cin >> accounts;
for (int i = 0; i < accounts; i++)
{
cout << "\n>> Enter your details for your Account: " << accCount << " <<" << endl;
newAccounts[i] = EnterAccountDetails();
if (newAccounts[i].accNo == 0)
{
for (int j = i; j < accounts; j++)
{
newAccounts[j] = newAccounts[j + 1];
accounts-=1;
}
break;
}
accCount++;
}
您的代碼段是不完整的查詢更多關於算法庫。你應該編輯它以包含所有相關的代碼,並編輯你的問題,如果可以的話,使用更好的語法。看看你現在擁有的東西,我可以告訴一些非常糟糕的事情發生在'EnterAccountDetails()'上,因爲之後你不得不應用一些醜陋的修復。 –
@CJMki我們可以看到你的EntrAccountDetails()函數代碼嗎? – Chris
@MichaelMcGuire:哎喲真不好意思。我是這個論壇的新手。 –