What is C++?

Bunty Kumar

Bunty Kumar

@bunty-kumar-gzZI1Q Oct 25, 2024
hello

Hemant


<snipped>

what is c++???????

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • bhuthecoder

    bhuthecoder

    @bhuthecoder-Yrm2I8 Dec 24, 2010

    C++ is an "object oriented" programming language created by Bjarne Stroustrup and released in 1985. google search for more details
  • Kaustubh Katdare

    Kaustubh Katdare

    @thebigk Dec 24, 2010

    Dr. Stroustrup had answered questions asked by CEans in our Small Talk. Check it out: #-Link-Snipped-#
  • Bunty Kumar

    Bunty Kumar

    @bunty-kumar-gzZI1Q Dec 27, 2010

    why we use constructor or destructor in c++ ?????????
  • Deepika Bansal

    Deepika Bansal

    @deepika-jf1ysv Dec 28, 2010

    Constructor is used to allocate the memory space to the object data members. It is also used to do some initializations. eg if we want to initially set the values of data members to some default values say zero, then constructor is used. Another use of constructor is that it is called immediately when the object is created and initialized. So if want some actions to perform at this time then we can use it inside constructor. For instance, if we want that whenever an object is created, we should ask for some values from the users. so we can do this step in the constructor.
    Constructors can be default constructor (with no parameters), parametrized constructor (with one or more parameter) and copy constructor (to copy one object to another). If we have not created any constructor inside the class definition, then the compiler automatically provides the default constructor to initialize values to zero.

    Similarly, destructor is used to de-allocate the memory location occupied by the object data members. It works exactly opposite to that of constructor.

    Also we can have one or more than one constructor in a class but we can have at the most only one destructor in the class.