anaisabelx2082 anaisabelx2082
  • 28-08-2017
  • Computers and Technology
contestada

To guarantee that the member variables of a class are initialized, you use ____.

Respuesta :

tonb
tonb tonb
  • 29-08-2017
a constructor, member initialization lists and also the default member initializer. Here you see all three (in reality you choose one construct per variable).

class A
{
  public:
    int x = 0;

   A() : x(1)
   {
      x = 2;
   }
};
Answer Link

Otras preguntas

9^-5/9^3 single positive exponent
PLEEAASE HELP MEEEEEEMatch each item in Column A to an answer in Column B.Which answer describes the solution to each equation?
Determine the domain and range for the inverse of f(x) = 1/4x + 2
This is the name given to the Nazi death camps in southeastern Poland that became arguably the most notorious of all the camps, killing approximately 1 million
Sarah drove 40 miles per hour . In 3 hours sarah drove 120 miles . Which is a vaild proportion to represent the problem?
[30 POINTS] An automobile steering wheel is shown. The ideal mechanical advantage of this wheel and axle = _____ .
What are the four countries with the largest spanish-speaking populations? México Guinea ecuatorial Argentina Puerto Rico España Colombia
Select the true statements about the Democratic Party. It is the oldest political party in the United States. The Democrats won the Presidency in the 90s but lo
3/5(x+2)=x-4What is the answer?Is it one solution,no solution, or Infinite solution?
was the articles of confederation based on the principle of separation of powers