3i Infotech Placement: Sample Questions 167 - 169 of 1245
Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.
Question 167
Describe in Detail Essay▾
What is late bound function call and early bound function call? Differentiate.
EditExplanation
- All virtual functions have late binding.
- All non-virtual functions will have early binding.
- Early binding happens at compile time.
- Late binding happens at runtime based on type of object referred a by a pointer variable.
- For example: base class B and derived class D have both implemented a method F () .
B ⚹ ptr = new D;
ptr ⇾ F () ;
- If F () is virtual then D՚s implementation is called.
- If F () is not virtual than B՚s implementation is called.
Question 168
Explanation
- An environment variable is accessed using getenv () .
- And set using the function putenv () .
Question 169
Describe in Detail Essay▾
#include<studio.h>
main ()
{
char s[] ={ ‘a’ ‘b’ ‘c’ ‘’ ‘c’ ‘⧵0’ };
char ⚹p, ⚹str, ⚹str1;
p =&s[3];
str =p;
str1 =s;
printf ( “%d” ++ ⚹p ++ +⚹ str1 − 32);
}
Explanation
- In a program
Table Shows the Program char s [] = { ‘a’ ‘b’ ‘c’ ‘’ ‘c’ ‘⧵0’ } ; Given the character array and values char ⚹ p, ⚹ str, ⚹ str1; Given three pointer variables p = &s [3] ; P is pointing to character ‘’ str1 = s; Str1 is pointing to character ‘a’ printf ( “% d” ++ ⚹ p ++ +⚹ str1 − 32) ; - ++ ⚹ p , here “p is pointing to ‘’ and that is incremented by one” .
- The ASCII value of ‘’ is 10, which is then incremented to 11.
- The value of ++ ⚹ p is 11
- ++ ⚹ str1 is pointing to ‘a’ that is incremented by 1 and it becomes ‘b’
- ASCII value of ‘b’ is 98
- Now performing (11 + 98 - 32) ,
- We get 77