摘要: char** argv == char* argv[]inint main(int argc, char* argv[])e,g: int (* pz)[2]; //a pointer(pz) points to an array of 2 ints.int * pax[2]; // 2 pointersdynamic multi-dimensional arrays in Cfunc(int x, int y, int a[x][y]) { ... }where the array dimensions are specified by other parameters to the fun 阅读全文
posted @ 2012-10-27 23:42 jeremyatchina 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 1. 使用在全域變數或全域函式 (Global variable &Global function)讓該變數(或該函式)的可視範圍只侷限在該檔案內,其他的 .c檔看不到此變數(或函式)的存在。既使其他檔案用extern宣告也看不到!套句行話來說,他把Global的變數或函數變成了「internal linkage」,當Linker在找symbol時是會忽略它的。(在C++中也相容這種用法,不過被視為比較不建議的舊的用法,C++比較建議使用unnamed namespace。)使用時機:當此全域變數(或全域函式)不想被其他檔案引用和修改時,或者不同檔案可以使用相同名字的全域變數(或全域函 阅读全文
posted @ 2012-10-27 12:32 jeremyatchina 阅读(2735) 评论(0) 推荐(0) 编辑
摘要: AbstractC語言並沒有提供一個函數專門將int, double轉字串,必須透過一個小技巧。Introduction有的compiler有提供itoa()與ltoa()將int, double轉字串,不過這些並非ANSI C標準,真正標準該使用sprintf()。double_to_string.c / C1/*2(C) OOMusou 2008http://oomusou.cnblogs.com34Filename : double_to_string.c5Compiler : Visual C++ 9.0 / Visual Studio 20086Description : Demo 阅读全文
posted @ 2012-10-27 12:01 jeremyatchina 阅读(271) 评论(0) 推荐(0) 编辑
摘要: Its no "string" data style in C language.If you really want string,then usetypedef char* string;So we have to use char array.Beginner always has some mistake here.e.g:Introductionchar s1[] = "Hello World";char *s2 = "Hello World";sizeofs1:12 // s1 is a arraysizeofs2:4 / 阅读全文
posted @ 2012-10-27 11:34 jeremyatchina 阅读(261) 评论(0) 推荐(0) 编辑