Languages-C & C Plus Plus [TCS Placement]: Sample Questions 36 - 37 of 119

Get unlimited access to the best preparation resource for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 36

C & C Plus Plus

Question

MCQ▾

Which of the following concepts means waiting until runtime to determine which function to call?

Choices

Choice (4)

a.

Dynamic binding

b.

Data hiding

c.

Dynamic loading

d.

Dynamic casting

Answer

a.

Explanation

  • Dynamic binding waits until runtime to determine the exact function to call
  • Dynamic Binding thus links a procedure call to the code that will be executed only at run time.
  • The code associated with the procedure in not known until the program is executed, which is also known as late binding.
  • Dynamic binding is an object oriented programming concept related with polymorphism and inheritance.
  • Dynamic dispatch means that the block of code executed with reference to a procedure (method) call is determined at run time.
Given the Image is Define the Dynamic Binding in C ++

Question 37

C & C Plus Plus
Edit

Describe in Detail

Essay▾

What is the difference between strings and character arrays?

Explanation

  • A major difference is: string will have static storage duration, whereas as a character array will not, unless it is explicitly specified by using the static keyword.
  • A string is a character array with following properties:
    • The multibyte character sequence is used to initialize an array of static storage.
    • The size of this array is just sufficient to contain these characters plus the terminating ‘NULL’ character.
    • Two strings of same value may share same memory area.
Given the Image is Define the Difference between Strings and Character Arrays

Developed by: