1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aksik [14]
3 years ago
6

Given the class definition: class CreateDestroy { public: CreateDestroy() { cout << "constructor called, "; } ~CreateDestr

oy() { cout << "destructor called, "; } }; What will the following program output? int main() { for ( int i = 1; i <= 2; ++i ) CreateDestroy cd; return 0; }
A. constructor called, destructor called, constructor called, destructor called,
B. constructor called, constructor called,
C. constructor called, constructor called, destructor called, destructor called,
D. Nothing
Computers and Technology
1 answer:
Vilka [71]3 years ago
5 0

Answer:

(A)constructor called, destructor called, constructor called, destructor called.

Explanation:

In the class definition we have created a constructor which prints constructor called and a destructor which prints destructor called.Since the class contains default constructors and destructors but when we define constructor and destructor in the class defaults are removed from the class.In the code the loop is running 2 times creating a object so constructor is called when that iteration finishes it deletes that object so destructor is called and it is happening 2 times.

You might be interested in
True or False: If you take a course and do not pass it, you still get credit. I feel like it's false but i'm not sure. Can I get
Margaret [11]
Its true because even if you fail a course it shows on your transcript....

8 0
3 years ago
Read 2 more answers
What is an lms and how is it used
Georgia [21]
A learning management system (LMS) is a software application for the administration, documentation, tracking, reporting and delivery of educational courses or training programs.
3 0
4 years ago
Read 2 more answers
Fill in the blank. THANK YOUU
Svetllana [295]

Answer:

She's procrastinating

Explanation:

3 0
3 years ago
What is a programming concept based on objects and data and how they relate to one another, instead of logic and actions. Hint:
Gre4nikov [31]
Object-oriented programming (OOP) is a computer programming model that organizes software design around data, or objects, rather than functions and logic.
3 0
3 years ago
A(n) systems analyst codes system software, fine-tunes operating system performance, and performs other system software-related
NikAS [45]
In general, a systems analyst is a person who uses analysis and design strategies to solve business problems.
They also analyze an organization’s current computer systems and develop information systems solutions to help the organization run more smoothly.

Now knowing a systems analyst job, therefore the answer to this is “FALSE”.

<span> </span>

6 0
4 years ago
Other questions:
  • ​________ establishes a connection between the​ computers, sequences the transfer of​ packets, and acknowledges the packets sent
    11·1 answer
  • How do you subscribe to Darthmaul Productions on YT?
    13·1 answer
  • When you record a macro, you can assign it to run from a button or from the _____.
    9·2 answers
  • --- is a set of applications that manages the activities and resources of a computer.
    12·1 answer
  • ____ arguments may provide more control over the returned value.
    13·1 answer
  • What is networking and types of networking?​
    6·1 answer
  • QUESTION 56 Use the Windows ________ to check on a nonresponsive program. Backup utility Error-checking System Restore Task Mana
    6·1 answer
  • if someone has become very attached to their mobile device and feels anxious if the cannot connect to the internet, what are the
    7·1 answer
  • The following questions requires manipulation an analysis of String objects. a. Create a class named String_Manipulation with a
    6·1 answer
  • What do you believe the year 2058 will be like? Reply with a link or a picture along with an explanation why. There should be a
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!