---
title: "Pointer in c++"  
description: "In this blog, I’m explaining about Pointer  in c++  PointerPointer is a variable that holds a memory address. This address is the location  of another"  
author: "priyanka kushwaha"  
published: 2015-01-30  
updated: 2015-01-30  
canonical: https://www.mindstick.com/blog/747/pointer-in-c-plus-plus  
category: "visual c++"  
tags: [".net"]  
reading_time: 1 minute  

---

# Pointer in c++

In this [blog](https://www.mindstick.com/articles/12705/myths-and-misconception-about-blog), I’m explaining about [Pointer](https://www.mindstick.com/articles/11/pointers) in [c++](https://www.mindstick.com/blog/745/array-in-c-plus-plus)\

##### Pointer

Pointer is a [variable](https://www.mindstick.com/articles/1807/objective-c-data-types-variables-object-creation) that holds a [memory](https://www.mindstick.com/blog/300050/what-causes-sudden-memory-loss) address. This address is the [location](https://www.mindstick.com/blog/11636/relocating-business-or-office-to-another-location) of another object in memory.

##### Two special pointer operators are : * and &.

The &[amp](https://www.mindstick.com/forum/156207/what-is-amp); is unary [operator](https://www.mindstick.com/blog/144/union-intersection-and-except-operator-in-sql-server) that returns the memory address of its operand. It is “ the address of” operand. The * is complement of & it is also a unary operator and returns the [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) located at the address .

##### Example:

```
int main(array<System::String ^> ^args){    int var= 10;             int *p;             p=&var;             cout<<"Value of var variable";             cout<<*p<<endl;           Console::ReadKey(0);    return 0;}
```

##### Example of function pointer

```
int main(array<System::String ^> ^args){          //example of function pointer     int var;     int (*ptest)(int)=test;     var=ptest(3);     cout<<var;     ptest=test2;     var=ptest(5);     cout<<var;      Console::ReadKey(0);    return 0;}
```

---

Original Source: https://www.mindstick.com/blog/747/pointer-in-c-plus-plus

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
