0% found this document useful (0 votes)
21 views3 pages

C

Uploaded by

srlohitkriishnaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views3 pages

C

Uploaded by

srlohitkriishnaa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Which other keywords are also used to declare the class other than class?

a) struct
b) union
c) object
d) both struct & union
The data members and functions of a class in C++ are by default ____________
a) protected
b) private
c) public
d) public & protected
Passing object to a function _______________
a) Can be done only in one way
b) Can be done in more than one ways
c) Is not possible
d) Is not possible in OOP
Which symbol should be used to pass the object by reference in C++?
a) &
b) @
c) $
d) $ or &
What is the type of object that should be specified in the argument list?
a) Function name
b) Object name itself
c) Caller function name
d) Class name of object
What is a friend function in C++?
a) A function which can access all the private, protected and public members of a class
b) A function which is not allowed to access any member of any class
c) A function which is allowed to access public and protected members of a class
d) A function which is allowed to access only public members of a class
An inline function is expanded during
a) compile-time
b) run-time
c) never expanded
d) end of the program

How can static member function can be accessed directly in main() function?
a) Dot operator
b) Colon
c) Scope resolution operator
d) Arrow operator
What is the syntax of a const member function?
a) void fun() const {}
b) void fun() constant {}
c) void const fun() {}
d) const void fun(){}
Which operator a pointer object of a class uses to access its data members and member
functions?
a) .
b) ->
c) :
d) ::
What is a copy constructor?
a) A constructor that allows a user to move data from one object to another
b) A constructor to initialize an object with the values of another object
c) A constructor to check the whether to objects are equal or not
d) A constructor to kill other copies of a given object.
How many parameters does a default constructor require?
a) 1
b) 2
c) 0
d) 3

How constructors are different from other member functions of the class?
a) Constructor has the same name as the class itself
b) Constructors do not return anything
c) Constructors are automatically called when an object is created
d) All of the mentioned

How many types of constructors are there in C++?


a) 1
b) 2
c) 3
d) 4

Which is the correct example of a binary operator?


a) ++
b) —
c) Dereferencing operator(*)
d) +
What is the syntax of overloading operator + for class A?
a) A operator+(argument_list){}
b) A operator[+](argument_list){}
c) int +(argument_list){}
d) int [+](argument_list){}

Explain about function overloading with an example program


Discuss about Explain about returning objects

Explain in detail about friend and virtual functions


(Or)
Discuss about arrays of object

Explain about c++ program with class


(Or)
Discuss about nesting of member functions

You might also like