---
title: "Define * and @ in Objective-C."  
description: "Define * and @ in Objective-C."  
author: "Tarun Kumar"  
published: 2015-12-18  
updated: 2020-09-19  
canonical: https://www.mindstick.com/interview/22947/define-and-in-objective-c  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 2 minutes  

---

# Define * and @ in Objective-C.

***** is used for indicating pointers, because Obj-C is based on C language and C language having pointers. Since all object variables are pointers that's needed for each and every object. and

**@** is used to identify NSString literals. If we will not use @ sign then it will be a C string. @ is a compiler directive which tell the compiler that this string is an Objective-C string. NSString and C strings are different so @ sign is used to differentiate them. but sometimes it relates to code or file constructs like @interface, @protocol, @implementation, and @end.

## Answers

### Answer by Tarun Kumar

***** is used for indicating pointers, because Obj-C is based on C language and C language having pointers. Since all object variables are pointers that's needed for each and every object. and

**@** is used to identify NSString literals. If we will not use @ sign then it will be a C string. @ is a compiler directive which tell the compiler that this string is an Objective-C string. NSString and C strings are different so @ sign is used to differentiate them. but sometimes it relates to code or file constructs like @interface, @protocol, @implementation, and @end.


---

Original Source: https://www.mindstick.com/interview/22947/define-and-in-objective-c

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
