Languages-C & C Plus Plus [3i Infotech Placement]: Sample Questions 272 - 274 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 272

C & C Plus Plus
Edit

Write in Short

Short Answer▾

What is a NULL Pointer? Whether it is same as an uninitialized pointer?

Explanation

  • Null pointer does not point to anything in the memory.
  • Null is defined as (void ⚹) 0.
  • Uninitialized pointer on the other hand is pointing to memory location but the pointer values are not assigned.

Question 273

C & C Plus Plus
Edit

Describe in Detail

Essay▾

Which bit wise operator is suitable for turning on a particular bit in a number?

Explanation

Understanding of XOR Operator
  • Bitwise OR operator sets a one in each bit position where one of its operands has a 1 ‘bit’ . That is, output of bitwise OR is 1 if at least one of the two operands has bit 1 in corresponding position.
  • To set a bit in the position, just OR it with the operand with the bit set.
  • Bitwise OR operator is denoted by ‘|’

Bitwise OR operation of 12 and 25

Question 274

C & C Plus Plus
Edit

Write in Short

Short Answer▾

Will the inline function be compiled as the inline function always? Justify.

Explanation

  • An inline function (marked with inline keyword) is a request and not a command.
  • Hence it won՚t always be compiled as an inline function.
  • Explanation:
  • Inline-expansion could fail if the inline function contains loops, the address of an inline function is used, or an inline function is called in a complex expression.
  • The rules for inlining are compiler dependent.
Given the Image is Define the Inline Function and Default Arguments

Developed by: