Languages-C & C Plus Plus [3i Infotech Placement]: Sample Questions 266 - 268 of 354
Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.
Question 266
Explanation
realloc | free |
Used to reset allocated memory size. | Used to destroy allocated memory size. |
Used when memory already created is sufficient. | The memory was already created. |
Invalid pointer parameter will produce unexpected results. | The pointer parameter created using calloc () or realloc () routines and should not deallocated with free. |
Question 267
Describe in Detail Essay▾
main ()
{
int i =3;
switch (i)
{
default:Printf ( “zero” );
case 1:Printf ( “one” );
break;
case 2:Printf ( “two” );
break;
case 3:Printf ( “three” );
break;
}
}
Explanation
In a program
int i = 3 | Integer variable i = 3 |
switch (i) { default: Printf ( “zero” ) ; case 1: Printf ( “one” ) ; break; case 2: Printf ( “two” ) ; break; case 3: Printf ( “three” ) ; break; } | The switch corresponding case 3 (since i = 3) is selected And as there is a break statement after it. It comes out of the loop And answer is three |
Question 268
Explanation
- A name clash occurs when a name “a” is defined in more than one place.
- For example, two different class libraries could give two different classes the same name.
- Program using many class libraries at the same time might be unable to compile or link because of name clashes.