]]>关于C中的文g描述W关联C++ ?iostreamhttp://www.shnenglu.com/nxm1990/articles/160548.htmlis-programmeris-programmerSun, 20 Nov 2011 04:55:00 GMThttp://www.shnenglu.com/nxm1990/articles/160548.htmlhttp://www.shnenglu.com/nxm1990/comments/160548.htmlhttp://www.shnenglu.com/nxm1990/articles/160548.html#Feedback0http://www.shnenglu.com/nxm1990/comments/commentRss/160548.htmlhttp://www.shnenglu.com/nxm1990/services/trackbacks/160548.html
Recently I has read object-oriend multithreading using C++ and find a interesting question ,: is it possible for us to use the file descriptor and socket to be linked to the object iostream ? the answer is no... even in the book is yes ,(osolete book);
This is a frequent question, and the answer is probably "no". At least with respect to standard C++, there's no way to obtain a descriptor from an fstream object or bind an fstream object to a descriptor. The reason, as your book suggested, is implementation dependecies. Just as new doesn't necessarily have to use malloc() to allocate raw memory, the fstream library isn't required to use stdio.h as its underlying implementation.
]]>C中的side effect ?sequence point http://www.shnenglu.com/nxm1990/articles/160085.htmlis-programmeris-programmerMon, 14 Nov 2011 07:08:00 GMThttp://www.shnenglu.com/nxm1990/articles/160085.htmlhttp://www.shnenglu.com/nxm1990/comments/160085.htmlhttp://www.shnenglu.com/nxm1990/articles/160085.html#Feedback0http://www.shnenglu.com/nxm1990/comments/commentRss/160085.htmlhttp://www.shnenglu.com/nxm1990/services/trackbacks/160085.htmlwiki ?sequence point 定义Q?/span> A sequence point in imperative programming defines any point in a computer program's execution at which it is guaranteed that allside effects of previous evaluations will have been performed, and no side effects from subsequent evaluations have yet been performed. They are often mentioned in reference to C and C++, because the result of some expressions can depend on the order of evaluation of their subexpressions. Adding one or more sequence points is one method of ensuring a consistent result, because this restricts the possible orders of evaluation. 单的说就是在C/C++中有一些执行顺序问题,C/C++定义了一些sequence pointQ在下一个sequence point 执行之前必须把前一个执行完Q但是问题是在一个sequence point 和另一个之间还有一些side effect。由于这些就引出一些有的问题?div style="display: inline-block; ">条gq算W?:、逗号q算W、逻辑?amp;&、逻辑或||的每一个操作数求g后是Sequence Point?br />问题一Q?br />