客观语言中的指针的意义是什么 [英] what is the point of pointers in objective language

查看:93
本文介绍了客观语言中的指针的意义是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎找不到在目标语言中实际使用指针的方法.我知道c#和java,并且不需要使用指针(这就是我的想法,它也被c#和java认为是dangoures编码),但是现在我开始学习Objective-C,我不明白为什么必须总是创建指向对象实例的指针.

I can't seem to find practical use of pointers in objective language. I know c# and java and there is no need to use pointers (thats what i think and it is also considered as dangoures coding by c# and java) but now im starting to learning objective-c and i cant figure out why you have to always create pointer to an object instance.

推荐答案

好吧,在c#中,您确实使用了指针,但没有明确使用.想想委托,匿名类型等.如果您不能有效地管理对这些引用类型的使用,则c#中的垃圾收集也会受到打击.

well, in c# you do actually use pointers, tho not explicitly. Think of delegates, anonymous types etc etc. the garbage collection in c# can also take a hit if you are not managing your use of these reference types efficiently.

在obj-c中,游戏表面更加暴露.我想这种方法有很多弊端,正是因为您上面提到的原因导致了内存gpf等的危险.

in obj-c, the playing surface is a little more exposed. I'd imagine that approach has as many cons as it has pros for exactly the reasons you stated above re the danger of memory gpf's etc.

慢慢地,赶上猴子:)

这篇关于客观语言中的指针的意义是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆