91. What is the correct syntax of declaring an array class?
92. Which is similar to template specialization?
93. Pick the correct statement.
94. Pick out the correct statement about sequence point.
95. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class Base
{
public:
virtual void print() const = 0;
};
class DerivedOne : virtual public Base
{
public:
void print() const
{
cout << "1";
}
};
class DerivedTwo : virtual public Base
{
public:
void print() const
{
cout << "2";
}
};
class Multiple : public DerivedOne, DerivedTwo
{
public:
void print() const
{
DerivedTwo::print();
}
};
int main()
{
Multiple both;
DerivedOne one;
DerivedTwo two;
Base *array[ 3 ];
array[ 0 ] = &both;
array[ 1 ] = &one;
array[ 2 ] = &two;
for ( int i = 0; i < 3; i++ )
array[ i ] -> print();
return 0;
}
#include <iostream>
using namespace std;
class Base
{
public:
virtual void print() const = 0;
};
class DerivedOne : virtual public Base
{
public:
void print() const
{
cout << "1";
}
};
class DerivedTwo : virtual public Base
{
public:
void print() const
{
cout << "2";
}
};
class Multiple : public DerivedOne, DerivedTwo
{
public:
void print() const
{
DerivedTwo::print();
}
};
int main()
{
Multiple both;
DerivedOne one;
DerivedTwo two;
Base *array[ 3 ];
array[ 0 ] = &both;
array[ 1 ] = &one;
array[ 2 ] = &two;
for ( int i = 0; i < 3; i++ )
array[ i ] -> print();
return 0;
}96. What happens when only one argument is supplied to reset() function?
97. Which of the follwoing function(s) of Array classes are similar to [] operator?
98. Where does the vector add the item?
99. What is the name of the myfile2 file after executing the following C++ code?
#include <stdio.h>
int main ()
{
int result;
char oldname[] = "myfile2.txt";
char newname[] = "newname.txt";
result = rename(oldname, newname );
if (result == 0)
puts ( "success" );
else
perror( "Error" );
return 0;
}
#include <stdio.h>
int main ()
{
int result;
char oldname[] = "myfile2.txt";
char newname[] = "newname.txt";
result = rename(oldname, newname );
if (result == 0)
puts ( "success" );
else
perror( "Error" );
return 0;
}100. Which type of relationship is modelled by Association?
Read More Section(C plus plus miscellaneous)
Each Section contains maximum 100 MCQs question on C plus plus miscellaneous. To get more questions visit other sections.
- C plus plus miscellaneous - Section 1
- C plus plus miscellaneous - Section 2
- C plus plus miscellaneous - Section 3
- C plus plus miscellaneous - Section 4
- C plus plus miscellaneous - Section 5
- C plus plus miscellaneous - Section 7
- C plus plus miscellaneous - Section 8
- C plus plus miscellaneous - Section 9
- C plus plus miscellaneous - Section 10
- C plus plus miscellaneous - Section 11
