What does the 'k' prefix indicate in Apple's APIs? [duplicate]

﹥>﹥吖頭↗ 提交于 2019-11-26 20:19:06

问题


This question already has an answer here:

  • Lower case “k” in Cocoa 2 answers

I've run across many examples of Core Foundation variables named k + someVariableNameHere or k + APILibraryName(2Char) + someVariableNameHere. What does this prefix K indicate?

Examples include:

kGLPFAStereo
kCollectionLockBit
kSetDebugOption


回答1:


The k means constant in hungarian notation... see Lower case "k" in Cocoa.




回答2:


This is a naming convention from the early days of macintosh programming. It indicates a constant.



来源:https://stackoverflow.com/questions/675816/what-does-the-k-prefix-indicate-in-apples-apis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!