You are on page 1of 4

C and CPP Questions:

1.What is size of void pointer?


A.
B.
C.
D.

two bytes
zero bytes
four bytes
16 bytes
2.What is the meaning of prototype of a function?

A.
B.
C.
D.

Implementation Of Function
Declaration Of a Function
None
Both
3.What will be output if you will compile and execute the following c code?
void main(){
int huge*p=(int huge*)0XC0563331;
int huge*q=(int huge*)0xC2551341;
*p=200;
printf("%d",*q);
}

A.
B.
C.
D.
E.

0
Garbage value
null
200
Compiler error
4.Recursive data structures are almost always implemented with memory from the ________

A.
B.
C.
D.

-stack
-heap
-processor
-RAM
5. What function should be used to free the memory allocated by calloc() ?

A.
B.
C.
D.

-dealloc();
-malloc(variable_name, 0)
-free();
-memalloc(variable_name, 0)

6.What is a size of empty class in c++?

A)4 bytes
B)2 bytes
C)0 bytes
D)1 bytes
7.______ is a default access specifier for members of class in C++.
A.
B.
C.
D.

protected
public
private
default
8.The static member variable is initialized to?

A.
B.
C.
D.

0
1
2
-1
9. ______ is the mechanism which allows a class A to inherit properties of a class B.

A.
B.
C.
D.

Data abstraction
Encapsulation
Inheritance
Polymorphism
10.What features make C++ so powerful?

A.
B.
C.
D.

Easy implementation
Code reusability
Easy memory management
All the above
11.Which of the following statement is correct?

A.
B.
C.
D.

Class is an instance of object.


Object is an instance of a class.
Class is an instance of data type.
Object is an instance of data type

A.
B.
C.
D.

12.Which inheritance type is used in the class given below?


class A : public X, public Y
{}
Multilevel inheritance
Multiple inheritance
Hybrid inheritance
Hierarchical Inheritance

13.In which format does the strings are stored?


A.
B.
C.
D.

Stack
Heap
Both a & b
None of the mentioned
14.How does the strings are stored in the memory?

A.
B.
C.
D.

Contiguous
Non-contiguous
Null
All of the mentioned
15.C++ actually supports the following two complete dynamic systems?

A.
B.
C.
D.

One defined by C and one specific to C++


One defined by C++ and the other not defined by C
Both are specific to C++
Both of them are improvements of C
16.Who is father of C++ Language?

A.
B.
C.
D.

Dr. E.F. Codd


James A. Gosling
Bjarne Stroustrup
Dennis Ritchie
17.Which of the following function / types of function cannot have default parameters?

A.
B.
C.
D.

Member function of class


Member function of structure
main()
Both B and C
18.What does the file iostream contain?
A. Declarations of the standard input-output library functions
B. Definitions of the standard input-output library functions
C. Both
D. None of the Above
19.Pick out the other definition of objects

A.
B.
C.
D.

member of the class


associate of the class
attribute of the class
instance of the class

20.How to access the object in the class?


A.
B.
C.
D.

scope resolution operator


ternary operator
direct member access operator
none of the mentioned

You might also like