C99

「<% %>」をCで使う

C C99

C99のCommittee Draft(N1124)を読んでいて、また目から鱗。以下のスクリプトがコンパイルできるという話。 #include <stdio.h> main() { <% puts("Hello world!"); %> } なんと、JSPスクリプトが記述できる…のではなく、これは次の仕様によるものでした。P64、PDF 上</stdio.h>…

C配列参照演算子の興味深い仕様

open-std.org のC99 Rationaleを読んでいて、興味深い一節を発見。 6.5.2 Postfix operators 6.5.2.1 Array subscripting The C89 Committee found no reason to disallow the symmetry that permits a[i] to be written as i[a]. The syntax and semantics …