Better HN
topnewbestaskshowjobs
Log inSign up

ouah

1 karma · joined Oct 16, 2011 (15y ago) · 3 submissions

http://ouah.org/ogay
Submissions

comment 11y ago · link · parent

"Incidentally, it is a common misconception that if c is a character variable, one can obtain the unsigned integer equivalent of c by writing (unsigned) c. This fails because a char quantity is converted to int before any operator is applied to it, even a cast. Thus c is converted first to a signed integer and then to an unsigned integer, with possibly unexpected results."

The "even a cast" part is wrong. The usual arithmetic conversions (including the integer promotion) is not done with the cast operation in C.

2.

How to Lock and Unlock Airbus A320 Cockpit Door (2002)(youtube.com ↗)

2 points · by ouah · 11y ago · discuss

comment 15y ago · link · parent

The case of typeof has already been discussed for C99 and it has been rejected. In ISO C99 Rationale document (section 6.7.7), it is written: "A proposed typeof operator was rejected on the grounds of insufficient utility." Don't forget most of the work of the C committee is spent in resisting features suggestions.