I have noticed this recently in C and C++ libraries. It seems common to use gFoo and kBar as forms of variable names. I assume "g" means global, but does "k" mean constant? I noticed that Atom and Visual Studio Code both highlight these forms with a different color, which would be convenient if I could understand their meaning. Are there any more conventions for naming the scope of variables, rather than their type as with Hungarian notation?
Edit: I found others, but I have not yet found the grammar file in Atom which describes these variable names.

g and m are scope prefixes, global and member. k is used for constant because c was used for char. The other 2 prefixes in your example are f for float and s for static.
More important than the internet's opinion on variable naming conventions is your boss's opinion on them, if they say k stands for constant in German, that is what it stands for :D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With