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
The resistance in a particular kind of circuit is found using this formula: R1(R2)R1+R2.
jenyasd209 [6]

Answer:

resistance = (R1 * R2) / (R1 + R2)

Explanation:

PYTHON doesn't recognize multiplication like this example >> 3(4)

This is why PYTHON uses this symbol (*)

3 0
3 years ago
4. A friend knows you are taking a technology class in college and asks you how a hard drive works. In your own words, describe
sveticcg [70]
Keep it simple... it holds whatever info' you want. would he/she understand?


3 0
3 years ago
Read 2 more answers
10 POINTS
Sunny_sXe [5.5K]

Answer:

True

Explanation:

They want to focus on their customers and their interests, so they market their products to a specific audience. hope this helps :)

4 0
3 years ago
What is an expansion slot?<br><br> Only Smart Person Can Answer My Question.. Do You ?
aev [14]
A place in a computer where an expansion card can be inserted.
7 0
3 years ago
Read 2 more answers
I need to code a simple racing game in c++. Help, please. ​
QveST [7]
Can you attach what you have so far
8 0
2 years ago
Other questions:
  • What does this program does?
    11·1 answer
  • An output device is any hardware component that allows you to enter data and instructions into a computer
    5·1 answer
  • Match each of the following terms to its definition:
    8·1 answer
  • Who knows coding questions? Please help! Thanks.
    6·1 answer
  • The music is the soul who says this
    12·1 answer
  • Data owners ensure that only the access that is needed to perform day-to-day operations is granted and that duties are separated
    10·1 answer
  • Key Categories: more libraries and thousands of functions
    5·1 answer
  • A question to determine your ability to use the reference materials effectively. Your boss has determined that you will be using
    9·1 answer
  • Video games, regardless of their level of realish, had added a new dynamic to the world games and Entertainment the ability to s
    9·1 answer
  • A homeowner uses a smart assistant to set the house alarm, get packages delivery updates, and set time on the outdoor lights. Wh
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!