Omitting the datatype (e.g. “unsigned” instead of “unsigned int”)

后端 未结 4 2007
猫巷女王i
猫巷女王i 2021-01-31 08:01

I know that if the data type declaration is omitted in C/C++ code in such way: unsigned test=5;, the compiler automatically makes this variable an int (an unsigned

4条回答
  •  北海茫月
    2021-01-31 08:44

    Gratuitous verbosity considered harmful. I would never write unsigned int or long int or signed anything (except char or bitfields) because it increases clutter and decreases the amount of meaningful code you can fit in 80 columns. (Or more likely, encourages people to write code that does not fit in 80 columns...)

提交回复
热议问题