Bear Bibeault wrote:Welcome to the Ranch.
Here's a couple of tips to help you get the most out of the Ranch.
Firstly, please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information. Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.
I've gone ahead and added the code tags for you. See how much easier the code is to read?
Secondly, never just tell us "there are errors". Show us.
Cut and paste the exact error messages, and be sure to UseCodeTags for them too so that the formatting is preserved.
Nazar Buko wrote:After playing around with the code i noticed that the constructor could also be written as ...
Nazar Buko wrote: it seems more efficient to do so
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors