Question-31. Can we implement all the concepts of OOPS using the keyword struct ?

Answer- Yes.

 

Question-32. What is the block scope variable in C++ ?

Answer- A variable whose scope is applicable only within a block is said so. Also a variable in C++ can be declared anywhere within the block.

 

Question-33. What is the role of the file opening mode ios::trunk ?

Answer- If the file already exists, its content will be truncated before opening the file.

 

Question-34. What is the scope resolution operator ?

Answer- The scope resolution operator is used to

• Resolve the scope of global variables.
• To associate function definition to a class if the function is defined outside the class.

 

Question-35. What is a namespace ?

Answer- A namespace is the logical division of the code which can be used to resolve the name conflict of the identifiers by placing them under different name space.

 

Question-36. What are command line arguments ?

Answer- The arguments/parameters which are sent to the main() function while executing from the command line/console are called so. All the arguments sent are the strings only.

 

Question-37. What is a class template ?

Answer- A template class is a generic class. The keyword template can be used to define a class template.

 

Question-38. What is the meaning of base address of the array ?

Answer- The starting address of the array is called as the base address of the array.

 

Question-39. When should we use the register storage specifier ?

Answer- If a variable is used most frequently then it should be declared using register storage specifier, then possibly the compiler gives CPU register for its storage to speed up the look up of the variable.

 

Question-40. Can a program be compiled without main() function ?

Answer- Yes, it can be but cannot be executed, as the execution requires main() function definition.