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

  • Home
  • SEARCH
  • 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 6348207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:22:35+00:00 2026-05-24T21:22:35+00:00

In this book I am currently reading I ran across this: A class doesn’t

  • 0

In this book I am currently reading I ran across this:

A class doesn’t need a constructor. A default constructor is not needed if the object doesn’t need initialization.

Am I correct in inferring from the above that the compiler does not generate a default constructor for the class/structure in some cases? If yes, what are those cases? I will venture and say POD is probably one. Are there any other?

EDIT: I have changed the title as the original title gave the meaning that I asked when was a default constructor not defined instead of asking when does a class not have a constructor at all.

  • 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-24T21:22:36+00:00Added an answer on May 24, 2026 at 9:22 pm

    A class doesn’t need a constructor. A default constructor is not needed if the object doesn’t need initialization.

    I think the author is talking about this situation:

    some_type some_function () {
       POD_type this_is_intentionally_uninitialized;
       ...
    }
    

    Under some circumstances a constructor won’t be called, period. As soon as you write a constructor you don’t have a POD class, so now the constructor will be called.

    Whether it is a good or bad thing to have an object running around that contains random, uninitialized data is a different question entirely.

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

Sidebar

Related Questions

I'm currently reading the book Professional Enterprise .NET and I've noticed this warning in
I'm currently reading Head First's Object Oriented Analysis and Design. The book states that
Currently I'm reading a book (Pro ASP.Net Framework). In this book, the author suggests
In a book I am currently reading, there is this excerpt: You can also
I'm currently reading this amazing book called Dive into Python. Up to now everything
I'm currently reading a book about ASP.NET MVC3 to learn working with this framework.
I'm reading this book on C# and .NET and I'm learning a bunch of
I have the following text tooooooooooooon According to this book I'm reading, when the
I'm reading this introductory book on parsing (which is pretty good btw) and one
I am currently reading a book about bit fiddling and the following formula appears:

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.