C++ Class Fundamentals online Test

Which of the following member functions is not created b compiler automatically ?


What is expected value of Myscore for the following code ?

#include <stdlib.h>

#include <iostream.h>

void main()

{

randomize();

int score[] = {25,20,34,56,72,63};

int Myscore;

Myscore = score[2+random(2)];

cout<<Myscore;

}


In which of the following case copy constructor is not called ?


How many times copy constructor is called in the following code ?(Assuming that class test is already created)

test tfunc(test u)

{

test v(u);

test w = v;

return w;

}

void main()

{

test x;

test y = tfunc(x);

test z = tfunc(y);

}


what will be the size of object of class B ?

class A

{

int x;

protected :

int y;

public:

int z;

};

class B:private A

{

int b;

};










































Description:

This test check your understanding of the most important concept of C++ that is classes.It covers basic class concepts,constructors,destructor as well as inheritance.In inheritance it checks your understanding of various visibility mode.it also checks your understanding of static and constant variables in classes

Comments

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
Kapil Vermani
BrainBench Certified Master C++ Programmer
User
20 Followers
Tests: 3

Your Facebook Friends on WizIQ

More Tests By Author

C,C++
10 Questions | 568 Attempts

C,C++
15 Questions | 505 Attempts

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect