C++ Questions

Q:

What are the methods are available in storing sequential files?

A) Natural merging B) Polyphase sort
C) Distribution of Initial runs D) All the above
 
Answer & Explanation Answer: D) All the above

Explanation:

ll the above listed methods are used in storing sequential files

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3751
Q:

Default constructor accepts how many arguments?

A) one B) two
C) three D) None
 
Answer & Explanation Answer: D) None

Explanation:

Default constructors has no arguments

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3750
Q:

What is the use of Namespace?

A) To encapsulate the data B) To structure a program into logical units.
C) Both a and b D) none of these
 
Answer & Explanation Answer: B) To structure a program into logical units.

Explanation:

The main aim of the namespace is to understand the logical units of the program and to make the program so robust.

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3717
Q:

Where is the reference stored?

A) stack B) heap
C) queue D) None
 
Answer & Explanation Answer: A) stack

Explanation:

Referencee is stored in stack

Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3664
Q:

What does inheriatance allows you to do?

A) create a class B) access methods
C) create a hierarchy of classes D) None of the mentioned
 
Answer & Explanation Answer: C) create a hierarchy of classes

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

1 3630
Q:

Explain storage qualifiers in C++

Answer

i.) Const - This variable means that if the memory is initialised once, it should not be altered by a program. 


ii.) Volatile - This variable means that the value in the memory location can be altered even though nothing in the program code modifies the contents. 


iii.) Mutable - This variable means that a particular member of a structure or class can be altered even if a particular structure variable, class, or class member function is constant.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

1 3597
Q:

Define void pointer using C++.?

Answer

In C++, void represents the absence of type, so void pointers are pointers that point to a value that has no type. The void pointers can point to any data type.


You can declare void pointer as follows:


void *p;

Report Error

View answer Workspace Report Error Discuss

Subject: C++
Job Role: Software Architect

0 3589
Q:

Different access specifiers for the class member in C++

Answer

Access specifiers in C++ determines the scope of the class members.


Public: If a class member is public, it can be used anywhere without the access restrictions.


Private: if a class member is private, it can be used only by the members and friends of class.


Protected: If a class member is protected, it can be used only by the members and friends of class and the members and friends of classes derived from class.

Report Error

View answer Workspace Report Error Discuss

Subject: C++

1 3573