class HasStatic {
static int I;
};
Referring to the sample code above, what is the appropriate
method of defining the member variable "I", and assigning it
the value 10, outside of the class declaration?
a) HasStatic I = 10;
b) int static I = 10;
c) static I(10);
d) static I = 10;
e) int HasStatic::I = 10;



class HasStatic { static int I; }; Referring to the sample code above, what is the approp..

Answer / guest

Ans e)

Is This Answer Correct ?    4 Yes 2 No

Post New Answer

More C++ General Interview Questions

Do vectors start at 0?

0 Answers  


How can you differentiate between inheritance and implementation in c++?

0 Answers  


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

0 Answers  


What are the various situations where a copy constructor is invoked?

0 Answers  


Explain the isa and hasa class relationships.

0 Answers  






founder of c++

7 Answers   Microtek, TCS, TeleCommand,


Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).

0 Answers  


what are difference between c and c++?

9 Answers   Accenture,


What are the advantages of using const reference arguments in a function?

0 Answers  


i want to know how to copy arrary without using any method or function. I have tried the below using System; class e4 { static void Main(string[] args) { int a,b; int[ ] m= new int[5]; int[ ] n= new int[5]; for(a=0;a<=4;a++) { Console.WriteLine("enter any value"); m[a]=Convert.ToInt32(Console.ReadLine()); m[a]=n[a]; } for(b=0;b<=4;b++) { Console.WriteLine(n[b]); } } } but it will give wrong result can anyone solve this problem

1 Answers   Reliance,


Evaulate: 22%5 a) 2 b) 4 c) 0

0 Answers  


Define whitespace in C++.

0 Answers   HCL,


Categories