Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6644675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:11:41+00:00 2026-05-26T00:11:41+00:00

help me in getting the concept of default constructor with example. i don’t know

  • 0

help me in getting the concept of default constructor with example.
i don’t know when to use default constructor in the program and when not to.
help me coming over this problem.explain it with an example for me.
when it is necessary to use it?

#include<iostream>
using namespace std;

class abc
{
public:
    abc()
    {
        cout<<"hello";
    }
};

int main()
{
    abc a;
    system("pause");
    return 0;
}

so actually what is the use of default constructor and when it is necessary to use it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:11:42+00:00Added an answer on May 26, 2026 at 12:11 am

    A class that conforms to the concept DefaultConstrutible allows the following expressions (paragraph 17.6.3.1 of N3242):

    T u; // object is default initialized
    T u{}: // object is value intialized
    T(); T{}; // value initialized temporary
    

    So much for the concept. Paragraph 12.1/5 actually tells us what a default constructor is

    A default constructor for a class X is a constructor of class X that
    can be called without an argument. If there is no user-declared
    constructor for class X, a constructor having no parameters is
    implicitly declared as defaulted (8.4). An implicitly-declared default
    constructor is an inline public member of its class. …

    With the introduction of deleted special member functions, the standard also defines a list of cases where no implicit default constructor is available and the distinction of trivial and non-trivial default constructors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there has to be a way: I need help getting any hot
Can anyone help me getting started with this? We have a current keygen for
I know this probably is not the easiest thing to do, but I am
The concept of this seems easy, but I'm having trouble getting it right and
I wrote my program but I'm not getting why its possible to possible to
I need help getting the this week full date range in the following format:
I need help getting my head around the difference between my current OOP notion
I'm looking for help getting started working programmatically with audio. Specifically, the platform I'm
I need a little help getting a tar file to download from a website.
I need help getting git extensions to run with msysgit. I have had bad

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.