Why is it thought of 'T *name' to be the C way and 'T* name' to be the C++ way?

后端 未结 10 875
梦谈多话
梦谈多话 2021-01-07 22:18

Note: This question is about the position of the asterisk (*).

In most C code I see (e.g., in Beej\'s guide to network programming), all variable declar

10条回答
  •  说谎
    说谎 (楼主)
    2021-01-07 22:36

    The reason why C programmers tend to use one style while C++ programmers use the other style is quite simple: Kernighan & Ritchie used the "C style" in their book, while Stroustrup used the "C++ style" in his book.

提交回复
热议问题