Sponsor Area

Constructor And Destructor

Question
CBSEENCO12011666

Observe the following C++ code and answer the question.

class Traveller
{
	long PNR;
	char TName[20];
public :
	Traveller() ...Function 1
	{
		cout<<'Ready'<<end1;
	}
	void Book(long P,char N[])...Function 2
	{
		PNR = P; strcpy(TName, N);
	}
	void Print() ...Function 3
	{
		cout<

Fill in the blank statements in Line 1 and Line 2 to execute Function 2 and Function 3 respectively in the following code:

void main()
{
	Traveller T;
 _________ ...Line 1
 _________ ...Line 2
 }...Stops here 

Solution
void main()
{
	Traveller T;
 T.Book(1234567,'Ravi');...Line 1
 T.Print();           ...Line 2
 }                    ...Stops here