Where does the k prefix for constants come from?

前端 未结 8 1586
北恋
北恋 2021-02-01 02:45

it\'s a pretty common practice that constants are prefixed with k (e.g. k_pi). But what does the k mean?

Is it simply that c

相关标签:
8条回答
  • 2021-02-01 03:14

    I haven't seen it that much, but maybe it comes from certain languages' (the germanic ones in particular) spelling of the word constant - konstant.

    0 讨论(0)
  • 2021-02-01 03:15

    K stands for konstant, a wordplay on constant. It relates to Coding Styles.

    It's just a matter of preference, some people and projects use them which means they also embrace the Hungarian notation, many don't. That's not that important.

    If you're unsure what a prefix or style might mean, always check if the project has a coding style reference and read that.

    0 讨论(0)
提交回复
热议问题