I'm creating a simple struct.
struct Expenses {
var totalExpenses:Int = 0
func addExpense(expense: Int) {
totalExpenses += expense
}
}
It produce error at the beginning of line totalExpenses += expense
The error message is
binary operator += cannot be applied to two Int operands.
Why I am getting the error message and how I can solve this issue?