4 ich of the following is the correct way to initialize data
4. ich of the following is the correct way to initialize data in the SharedSet if data is a dynamic array a) static double SharedSet: data new dou- b) static double\" data new double 50 ble 50); c) double shared set data new double(50) d) double Sharedset: data new double;
Solution
Please find the answer below:
c) double* SharedSet::data = new double[50];
here because the member variable in SharedSet data is static, so while defining the variable data, we cannot use static keyword, thus options a and b are wrong. Also as we are defining a double array thus fourth option d was also wrong as it doesnot specifies the array size while initializing.
