What is the reason for underscore in C variable name definition?

前端 未结 3 568
忘掉有多难
忘掉有多难 2020-11-29 12:45

I am trying to understand when a developer needs to define a C variable with preceding \'_\'. What is the reason for it?

For example:

ui         


        
3条回答
  •  自闭症患者
    2020-11-29 13:21

    whether its C or not, the leading underscore provides the programmer a status indication so he does not have to go look it up. In PHP, or any object oriented language where we deal with tens of thousands of properties and methods written by 1000's of authors, seeing an underscore prefix removes the need to go dig through the class andlook up whether its declared private, or protected or public. thats an immense time saver. the practice started before C, i am sure...

提交回复
热议问题