Submitted Questions

  • C++ Interface

    Is it possible to create an interface in C++? If Yes, how?

    Zeeshan Mohammad

    • Dec 12th, 2014

    I would prefer to write a structure and declare a function there for interface.

    Code
    1.  
    2. typedef struct _ITestInterface
    3. {
    4.         virtual void testFunc() =0;
    5. }ITestInterface;
    6.  

    Mohit

    • Jul 31st, 2014

    Yes you can do it by making a function with help of virtual keyword

    Code
    1. class StockPrice
    2. {
    3.    virtual void CalculateStockPrice() = 0;
    4. }