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

Why did the middle eastern nations slow oil production in 1973 causing an oil crisis?
Which of the following is the current, accepted model of the atom? plum pudding model Rutherford-Bohr model wave mechanical model A metal and a non-metal typica
How many protons are present in one copper(ii) ion?
The backbone is made up of many small bones called
tims age in 7 years. will be 3 times what it was 19 years ago
which of the following is true of functions and their inverses a) the inverse of a linear function is always a function. b) the inverse of a quadratic function
Why do most people in china live on the north china plain?
A bag of potatoes and a bag of oranges weigh 30 pounds in all. The weight of the potatoes is 5 pounds less than 4 times the weight of the oranges. Let w represe
How could you find the number of different combinations of 6 letters in a computer password?
please help asap 50 pts