You are on page 1of 1

1.What is the most efficient way to reverse a linklist?

2.How to sort & search a single linklist?


3.Which is more convenient - single or double-linked linklist? Discuss the trade-
offs? What about XOR-linked linklist?
4.How does indexing work?
5.char s[10];
s="Hello";
printf(s);
6.What will be the output? Is there any error with this code?
7.What is the difference between
8.char s[]="Hello";
char *s="Hello";
9.Please give a clear idea on this?
10.Why do we pass a reference for copy constructors? If it does shallow copy for
pass by value (user defined object), how will it do the deep copy?
11.What is the difference between shallow copy & deep copy?
12.What is the difference between strcpy and memcpy? What rule should we follow
when choosing between these two?
13. The declaration char s[10] implies that �s� has a fixed adrress in memory i.e
it is a constant pointer.
14.The right hand operand produces a pointer to a memory location that holds the
character string �Hello�.
15.Thus, it is clear from this code that there is an attempt to modify a constant
pointer by assigning it an address.
16.This will give compilation error.
char s[]=�Hello�;
char *s=�Hello�;
17.The only difference between the two statements is that the former is declaring
a �constant pointer to a variable string� while the latter is
declaring a �variable pointer to constant string�.
i) char s[] = �Hello�; �s� is constant pointer

we can change its contents like


s[0] = �b�, s[1]=�y', s[2] = �e� ..so on

ii) char *s = �Hello�; �s� is a variable pointer.


we cannot change its contents like above. Doing so produces run time errors.

You might also like