My today's CS201 Paper 22-07-2011
Suppose there is class A having data member 'x', 'y' and an object of class B. The class
B has data members 'z'. Write the constructor of a class A that initializes the data
members of class A and class B (using member initializing list). [2]
How can we declare and initialize static data members of a class? [2]
Write down the general syntax for a function that returns a reference? [2]
Differentiate between single-dimensional and multi-dimensional array? [2]
How many arguments does binary member operator function binary non-member
operator function take? [3]
What is an alternative of setw manipulator? [3]
Find the error in the given code [3]
for (int i=0; i<numRows; i++)
{
for (int j=0; j<numCols; j++)
}
elements[i,j] =m.elements [i][j];
}
}
Determine the output of following code segment. [3]
x=5;
Switch (x)
{
case 5;
cout<<Value is 5;
case 4;
cout<<Value is 4;
break;
}
What is meant by the lifetime of a variable and what is the lifetime of an automatic
variable? [5]
Write a short note on files and also explain how they are handled in C++? [5]
Find the error [5]
class Data
{
private:
const in data;
public:
Data( )
{
cout<<"Constructor Call…\n"; }
void getIncreament( )
{
Cout<<"Data = " <<++data;
}
};
void main( )
{
char*String ;
String= New char[15];
String="Welcome to VU";
cout<<String;
free (String);
}
I Hate Spammers Don't Make Me Angry
--
You received this message because you are subscribed to the Google Groups "Virtual University of Pakistan" group.
To post to this group, send email to discussion_vu@googlegroups.com.
To unsubscribe from this group, send email to discussion_vu+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/discussion_vu?hl=en.
No comments:
Post a Comment