---
title: "Why we use ^ Symbol in Objective-C?"  
description: "Why we use ^ Symbol in Objective-C?"  
author: "Anonymous User"  
published: 2015-12-18  
updated: 2015-12-18  
canonical: https://www.mindstick.com/forum/33751/why-we-use-symbol-in-objective-c  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# Why we use ^ Symbol in Objective-C?

I am [beginner](https://www.mindstick.com/forum/23159/need-beginner-project-ideas) in Objective-C, I saw many examples on Obj-C [language](https://www.mindstick.com/startup/28/preply-the-fast-growing-platform-transforming-language-learning), using ^ simbol.\
Can [anyone tell me](https://www.mindstick.com/interview/23033/can-anyone-tell-me-about-hadoop-toolbox) what is the use of ^ in Obj-C.\
If you give me an example then it will be very [helpful](https://yourviews.mindstick.com/view/81752/oximeter-for-covid-patients-is-helpful-tool) for me.\
Thanks.

## Replies

### Reply by Tarun Kumar

**^** is called as **"Caret"**. In Objective C, **^ operator** is used to declare a block variable and also used to indicate the beginning of a block literal, the body of block is contained within { } (curly braces).\
Here is an example with its explanation:

```
int num1 = 10;int (^abcBlock)(int) = ^(int num2) {      return num2 * num1;    }
```

in this example- **Block-name** is **abcBlock** and the **return-type** of abcBlock is **int**, the abcBlock has an **argument** which is also an **int**.\
now, next to the assignment(=) operator, the code **^(int num2) { return num2 * num1; }** is a **literal** **block** definition having **num2** as an **abcBlock argument-name**, and the code between the **{ }** curly braces is used as the **body** of the abcBlock.\


---

Original Source: https://www.mindstick.com/forum/33751/why-we-use-symbol-in-objective-c

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
