fgetc()返回值是int而不是char
其实是个很简单的常识,居然搞了我半个小时……
fgetc()的返回值是int,因为这个值除了返回拿到的字符之外,还兼作错误标志。由于fgetc()允许文件中包含任意内容,所以只好增大返回值的宽度来表达。
共7篇文章。
其实是个很简单的常识,居然搞了我半个小时……
fgetc()的返回值是int,因为这个值除了返回拿到的字符之外,还兼作错误标志。由于fgetc()允许文件中包含任意内容,所以只好增大返回值的宽度来表达。
看来还是学的太少了。之前只是注意到内核有提供这样一个接口,等到kris来信才知道,这个接口和其他平台上都不一样-_-#
在POSIX中提到,这个API不仅可以修改输入参数,而且可以返回一个静态存储的指针,说白了,你不能指望某个平台上它是线程安全的,也不能指望它不会修改你发给它的数据……
将个性化的factory提取出来,改为使用通用的factory生成同一协议的protocol对象,并将业务逻辑对象作为factory的一个参数。这样做使得代码冗余大大降低了。
I used to think that ldap_unbind() is the opposite of ldap_bind(),however I was wrong. Pierangelo Masarati (ando at openldap) pointed out
that it was actually opposite of ldap_init(). So, do NOT expect init() -> bind() -> search() -> unbind() -> bind() would success, it’s
simply wrong thing. You do not need to unbind() before you do another bind().
Just make a note.
Apparantly des@ has pointed out a serious problem with my patchset,say, the inconsistency of underlying API is the root of evil™, and should be corrected.
Let’s go go go!
This is really insteresting one. With an “advertised” shell link, Windows Installer will automatically executed to install on demand.