Account Operations
Challenge on lesson: Checkpoint: Structs
CHALLENGE
Difficulty: beginner+25 XP
Given struct Account { int balance; }; in scope, implement void deposit(struct Account *a, int amount) adding amount, int withdraw(struct Account *a, int amount) subtracting and returning 1 only if the balance stayed >= 0 (else 0 and no change), and const struct Account* richest(const struct Account *as, int n) returning the account with the highest balance.
Press Submit to check your solution.
Back to lesson: Checkpoint: Structs