Submitted Questions

  • Floating Point Numbers

    Why in c++ (0.1 + 0.1) is not equal to 0.2 ??

    Sandhya.Kishan

    • Mar 12th, 2012

    The floating-point arithmetic in most computer languages is based on binary fractions (1/2, 1/4, 1/8, 1/16, ...) and not decimal fractions (1/10, 1/100, 1/1000, 1/1000,...)there is no ActionScript Number that is exactly equal to 0.1 because it require an infinite number of binary fractional bits.

  • Can I stop people deriving from my class?

    Zubair

    • Jan 18th, 2012

    Yea It is possible in C++. Here is the code snippet. "cpp using namespace std; class Sample; class SampleBase { friend class Sample; public: private: SampleBase() { } Samp...

    Amit

    • Jan 6th, 2012

    If you make all the constructor and assignment operator private of a class then logically you can prevent any other class to use your base class. Even your derived class can inherit the base class (t...