Ad Code

Responsive Advertisement

Default Constructor in C++








programs of Default constructor :

#include<iostream>
#include<stdlib.h>
using namespace std;
class abc{
 int a;
 public:
 abc(){
  a=10
  cout<<"Defalut constructor is called";
 }
};
int main(){
 abc st;
}


out put:
20 



If you like code with vibhu  and would like to contribute, you can also write an article using   This link :

https://docs.google.com/forms/d/e/1FAIpQLScAmvlPvNUz35R-G0nc_zpRVP3o8xlhtFgC3aKPyLetX_RyXg/viewform?pli=1


OR  mail your article to codewithvibhu@gmail.com.  See your article appearing on the code with vibhu main page and help other students. 
❮ Previous                                                      Next ❯

Post a Comment

0 Comments