standards - signed as default in C -


once again, i'm teaching class answer students questions c. here's 1 don't know answer to: there rationale behind accepting signed default modifier c? 1 have thought unsigned natural choice. so, design decision?

in terms of standard (since question tagged such), signed marked default because that's how c implementations came before standard.

the original ansi/iso standard mandates codify existing practice rather create new language. hence behaviour of pre-standard implementations important factor, per rationale document:

the original x3j11 charter mandated codifying common existing practice, , c89 committee held fast precedent wherever clear , unambiguous.

the vast majority of language defined c89 precisely same defined in appendix of first edition of c programming language brian kernighan , dennis ritchie, , implemented in c translators of time. (this document hereinafter referred k&r.)

if you're looking find out why pre-standard implementations preferred signed, you'll have architecture of pdp-n machines unix , c developed.

the history of c page shows unsigned relative latecomer language, appearing sometime in mid '70s:

during 1973-1980, language grew bit: type structure gained unsigned, long, union, , enumeration types, , structures became first-class objects (lacking notation literals).


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -