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

C & C Plus Plus

Describe in Detail


What is a pointer?


Understanding of Pointer to a Variable
  • Pointer in C language is a variable that stores the address of another variable.
  • A pointer in C is used to allocate memory dynamically at run time.
  • The pointer variable might “point” to any the data type as int, float, char, double, short etc.


Data_type ⚹ var_name;


int ⚹ p;

char ⚹ p;

  • Where, ⚹ is used to denote that “p” is pointer variable and not a normal variable.

Question 181

C & C Plus Plus

Write in Short

Short Answer▾

Difference between pass by reference and pass by value.


Difference between Pass by Reference and Pass by Value
Pass by valuePass by reference
Passes an argument by value.Passes an argument by reference.
Specified the ByVal keyword.Specified the ByRef keyword.
The procedure code does not access the underlying element in the calling code.The procedure code gives a direct reference to the programming element in the calling code.
We are sending a copy of the data.We are passing the memory address of the data that I stored.
Changes do not affect the actual value.Changes to the value affect the original data.

Developed by: