What are differences between pointers and arrays?

Explain the similarities and differences between pointer variables and array variables in C++.


2 Answers
1-2 of  2
2 Answers
  • Pointer variables can be incremented but array variables can't be incremented/decremented.
    Size of array is the sum of size of its elements contained in it whereas pointer size is simply no. of bytes assigned to pointer variable.

  • an array is a collection of variables of similar data type whereas the pointer is a variable that stores the address of another variable.

Object Oriented Programming

Didn't get the answer.
Contact people of Talent-Object Oriented Programming directly by clicking here