Can anybody tell me the difference between a vector & a pointer ???
Printable View
Can anybody tell me the difference between a vector & a pointer ???
A vector has direction and size (magnitude). Acceleration is a vector for example. People also refer to a one-dimensional array as a vector.
A pointer is a simple variable that holds an integer. In the variable is an address in computer memory. That address is the location of another variable. Passing a variable to a subroutine by reference (the address of the variable is placed on the stack) is an example of using a pointer. Pointer are more interesting than just this base definition. You cannot program in C or C++ without them.