Where does the k prefix for constants come from?

前端 未结 8 1604
北恋
北恋 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 02:49

    It's a convention, probably from math. But there are other suggestions for constant too, for example Kernighan and Ritchie in their book "The C language" suggest writing constants' name in capital letters (e.g. #define MAX 55).

提交回复
热议问题