C++

The Features of C++ as a Language.

Now that all the necessary theory has been covered, now it is possible to explain what C++ has to offer as a programming language. C++...

  1.  It is an open ISO-standardized language.
        For a time, C++ had no official standard and was maintained by a de-facto standard, however since 1998, C++ is standardized by a committee of the ISO. Their page may be accessed here.

       2.  It is a compiled language.
        C++ compiles directly to a machine's native code, allowing it to be one of the fastest languages in the world, if optimized.

        3. It is a strongly-typed unsafe language.
        C++ is a language that expects the programmer to know what he or she is doing, but allows for incredible amounts of control as a result.

       4.  It supports both manifest and inferred typing.
        As of the latest C++ standard, C++ supports both manifest and inferred typing, allowing flexibility and a means of avoiding verbosity where desired.

       5.  It supports both static and dynamic type checking.
        C++ allows type conversions to be checked either at compile-time or at run-time, again offering another degree of flexibility. Most C++ type checking is, however, static.

        6. Offers many paradigm choices.
        C++ offers remarkable support for procedural, generic, and object-oriented programming paradigms, with many other paradigms being possible as well.

        7. Portable
        As one of the most frequently used languages in the world and as an open language, C++ has a wide range ofcompilers that run on many different platforms that support it. Code that exclusively uses C++'s standard library will run on many platforms with few to no changes.

        8. Upwards compatible with C
        C++, being a language that directly builds off C, is compatible with almost all C code. C++ can use C libraries with few to no modifications of the libraries' code.

        9. Possess incredible library support.
        A search for "library" on the popular project-management website SourceForge will yield over 3000 results for C++ libraries. A link to the results of the search may be found here.
    C++ fully supports object-oriented programming, including the four pillars of object-oriented development:

    ·        Encapsulation

    ·        Data hiding

    ·        Inheritance

    ·        Polymorphism


    A class definition starts with the keyword class followed by the class name; and the class body, enclosed by a pair of curly braces. A class definition must be followed either by a semicolon or a list of declarations. For example, we defined the Box data type using the keyword class as follows:


    The keyword public determines the access attributes of the members of the class that follow it. A public member can be accessed from outside the class anywhere within the scope of the class object.

    Class is a collection of data member and member function. Class is a user define data type.

     Object  is a class type variable. Objects are also called instance of the class. Each object contains all members(variables and functions) declared in the class.

    ·        Object - Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors - wagging, barking, eating. An object is an instance of a class.

    ·        Class - A class can be defined as a template/blueprint that describes the behaviors/states that object of its type support.

    ·        Methods - A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed.

    ·        Instance Variables - Each object has its unique set of instance variables. An object's state is created by the values assigned to these instance variables.
Return to top