摘要: warning: ISO C90 forbids mixed declarations and code通常會出現這種warning message是因為變數的宣告太後面在宣告變數的前面不可以有其他的執行運作。但是有執行所用到的變數要距離越近,執行的效率越好的觀點但個人覺得在Interpreter Language而言會比較有作用,因為對C來說,Code Optimization後,應該不會有這個議題存在。 阅读全文
posted @ 2013-01-02 15:55 jeremyatchina 阅读(383) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <errno.h> int main (){ FILE * file; file=fopen ("exist.not","rb"); if (file==NULL) { perror("perror"); printf("strerror(errno)=%s\n", strerror(errno)); } else fclose (file); return 0;} 当linux中的C api函数发生异常时,一般会将errno变量(需in 阅读全文
posted @ 2013-01-02 00:09 jeremyatchina 阅读(525) 评论(0) 推荐(0) 编辑