Conceptuals

C++

1. Name the four kind of functions that a c++ compiler is able to provide by default.

2. Name the four operators that a C++ programmer cannot overload.

3. What is passed to and what is returned by the put-to operator in the following case :
		cout<<1.0 ;

4.If both the following statements in the code below are accepted by the compiler, then name one possible relation between a,line and circle?

void main()
{
	.
	.
	.
	a = new line ;
	.
	.
	.
	a = new circle ;
	.
	.
	.
}
		
C:

1.What should p be declared as so that the following assigment is error free?What is the value of sizeof(*p)?
	int a[3][4] ;
	.
	.
	.
	p = a ;

2.What is the error reported by the compiler when we write 
	++a++ when a is an integer. Would this error disappear had the unary pre increment operator be implemented to return the reference of the integer?Why?


3.What is the range of the variable p in the following case:
	int p:5 ;
How do i get a range of 0 to +7?

4.Which are the three kinds of operators whose associativity is from right to left?
Which is the operator with the lowest precedence?



C++

Ans1:	Constructor, Copy Constructor, Assignment operator, Destructor
Ans2:	dot, scope resolution, sizeof operator, ternary conditional 	operator
Ans3:	<< receives an ostream object by reference and a double by value and returns the ostream object by reference.
Ans4:	a is an object of a base class from which the classes line and circle are derived.

C
Ans1:	int (*p)[4] ;
	sizeof(p) is 8.
Ans2:	Lvalue required.
No, because unary operators have right to left associativity and this error can be removed if unary post-decrement operator returns the reference of the integer.
Ans3:	Range : -16 to +15 
	unsigned int p:3
Ans4:	unary operators, assigment operators, ternary conditional operators
Comma operator has the lowest precedence
