Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Remove element from a list in C
- Account AccountList::remove(int i){
- if(i>=0 && i<size()) {
- for (int n = i; n < size(); n++) {
- if(i+1!=size()) {
- aList[n]=aList[n+1];
- }
- }
- sz--;
- return aList[i];
- } else {
- return Account();
- }
- }
- Account AccountList::remove(int i)
- {
- if(i>=0 && i<size())
- {
- Account a = aList[i]
- for (int n = i; n < size() - 1; n++)
- {
- if(i+1!=size())
- {
- aList[n]=aList[n+1];
- }
- }
- sz--;
- return a;
- } else
- {
- return Account();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment