
Technology | Embedded Systems | INR 800 / Hour |
College Level | Mathematics Computer Science IT | INR 300 / Hour |
Engineering Subjects | Computer IT | INR 300 / Hour |
Graphics & Multimedia | Multimedia | INR 100 / Hour |
Programming Language | C C++ | INR 500 / Hour |
in c++ we can use virtual functions to achive "Run time polymorphism". There does not exist any term called "virtual polymorphism".
we can define virtual functions in base class and we must have minimum one level inheritance defined in our class definitions. main() function should have pointer to base class which points to derive class object. Then if we access methods of derive class m ethods using base class pointer to an object.
Translation happes at run time which method ( about which method will be called i.e. base class method or derive class method). Make sure we must have funt ion overriding in place ( in both the classes we must have same function defined).
cosnt in C++ is a key word use to keep variable's value unchanged throughout the execution of function.
const int i = 9;
value of i can not be changed till the scope of variable i exist.
C++ have methods which operate on data which C direcly operates on data.
c++ have many features such as polymorphism, function overloading, operator overloading, inheritance (reusability) , etc.... while if we want to do such things in C then we have to use function pointers.
C++ have objects and classes in which object contains responsibility through which we can access methods while in C there does not exist any kind of such things.
C++ operates on bottom to up approach which C has top to bottom approach in execution.
C++ has a concept called reusability in which repetation of the code can be saved while in C such things does not exist.
basic data types such as int, float, char, long , long long int, unsigned long long int, double definately exist in C++ but along with that user defined data types also exist such as class, templates, arrays.
static members of class must be utilized within static method of the class. static members preserves values between function calls. static members scope remains till the single file scope . non static members can be accessed by normal functions.
abstraction can be achieved using virtual functions.
class base_abstract { int my_var; public:
base_abstract() { }
void get_value() = 0; };
class derive : public base_abstractct int g; public: void get_value() { int var; cin >> var; g = var; }
};
In this example base_abstract is abstract class. ===========================================================================
polymorphism meanin is one name many meaning. There are 2 type of polymorphism : compile time and run time. compile time : function overloading and operator overloading. run time: virtual functions.
protected is having 1 class hirerchy access. If we have derived class using protected inheritance then base class all public and protected member functions and member variable becomses protected in derive class. and we can access those things using methods define in the derive class' protected member functions.
Post your requirement in LearnPick