const int *p vs. int const *p - Is const after the type acceptable?

前端 未结 15 1684
萌比男神i
萌比男神i 2020-12-08 05:01

My co-worker is 0 for 2 on questions he has inspired (1, 2), so I thought I\'d give him a chance to catch up.

Our latest disagreement is over the style issue of wher

15条回答
  •  死守一世寂寞
    2020-12-08 05:33

    Rules are good to follow. Simpler rules are better. Const goes to the right of what's const.

    Take this declaration:

    int main ( int const argc , char const * const * const argv ) ...

提交回复
热议问题