In objective-C, what's the difference between Type * var and Type * var?

Oh, the joys of noob memory management!

I am a little versed in Objective-C code, although I understand the basics of pointers, I saw these two different constructs, not being able to understand their difference.

Can someone enlighten me?

Having edited my question, the constructions did not behave differently; instead, I again got the cue ball with a few announcements. Thank!

+3
source share
3 answers

There is no difference - it is a matter of taste. However, be careful that the pointer is actually always bound to a name, not a type. So:

Type* var1, var2;

var1 Type, var2 . .

, Type *var C, "var Type", " *var Type". , ++ Type* var "var " Type ".

+5

.

:

Type* var1, var2;

var1 Type, ,

Type *var1, var2; 
+2

, -? . Objective-c, C

Type* var
Type * var
Type *var

/.

Unless you are talking about variable declaration , but access ?

0
source

Source: https://habr.com/ru/post/1756715/


All Articles