c++ - Read Only Variable Assignment? -


i have private member variable called "probes", within 1 of private member functions, want use variable "probes" keep track of number of comparisons made. put variable within loop , did probes++ each time through. when compile , run it, says cannot assign read variable? how can correct this?

if read variable (constant) cannot probes++ (which similar probes = probes + 1) because constants cannot updated. can declare variable (which can modify while program executed) or declare probes mutable.


Comments