graph - ISO C++ forbids intilization of member maxY -


that's code using graphs in arduino i'm getting error saying iso c++ forbids intilization of member maxy. can know why?

class graph  {   float maxy = 0;   float maxx = 0;   int maxi = 0;   boolean dot=true;               boolean rightaxis;               boolean errorflag=false;         boolean showmouselines=true; 

because c++ forbids initialisation of instance members in-line that.

you should initialise them in constructor or, if they're meant class variables (one shared across all instances) rather instance variables, make them static.


Comments