Hello: I'm doing my first class. I would like to know how to prevent the creation of more than one object from this class.
Thank in advance.
(deleted)
I think the problem is throwing a compile-time error.
Maybe a good C programmer has a little library the throws an error if a static variable exceeds 1.
I'm pretty sure gcc/avr won't let you.
Basically by making the constructor privat/protected.
See Singleton
Sorry about delayed answer. Many thanks for the help, I declared the constructor as private and I created a static method to achieve it. It works very well.