Category "methods"

Writing A Recursive Function That Counts Zeros

It is possible to count the number of zeros in an integer through a recursive method that takes a single int parameter and returns the number of zeros the param

how to override the equals() method when you have to compare 7 instance variables? [duplicate]

I am currently doing my programming assignment. But there is one step that i don't quite understand. There are 7 private instance variables an

Should virtual dispatch happen when a virtual method is called within a virtual method using object?

struct B { virtual void bar () {} virtual void foo () { bar(); } }; struct D : B { virtual void bar () {} virtual void foo () {} }; Now we call foo()

Using strings instead of enums?

Is it common place to use a string for comparison as opposed to an enum?