摘要: ---- 大概大家还记得Delphi的范例程序中的那个浏览器的例子吧。在那个例子中,利用控件THttp的属性和方法制作了一个浏览器。该例子用于理解THttp控件的使用方法,确实不错。但很少有人会用它作为一个真正的浏览器,原因很简单,功能太有限了,不支持Frame,不支持Script脚本语言,不能以本地文件方式查看HTML文件等等。大部分用户在使用IE或Navigator;我们程序员也乐意使用现成... 阅读全文
posted @ 2009-03-01 04:43 谭志宇 阅读(692) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int main() { int*a = (int*)malloc(11 * sizeof(int)); size_t size=_msize(a); cout<<size / sizeof(int)<<endl; free(a); return 0; ... 阅读全文
posted @ 2009-03-01 04:37 谭志宇 阅读(242) 评论(0) 推荐(0) 编辑
摘要: #include void comb(int n, int curr, int d, int * sol) { if (curr == d) { int i; for (i = 0; i = 1; --i) { sol[curr] = i; comb(i-1, curr+1, d, s... 阅读全文
posted @ 2009-02-19 17:20 谭志宇 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 指针是一个特殊的变量,它里面存储的数值被解释成为内存里的一个地址。 要搞清一个指针需要搞清指针的四方面的内容:指针的类型,指针所指向的 类型,指针的值或者叫指针所指向的内存区,还有指针本身所占据的内存区。让我们分别说明。 先声明几个指针放着做例子: 例一: (1)int*ptr; (2)char*ptr; (3)int**ptr; ... 阅读全文
posted @ 2009-02-17 11:58 谭志宇 阅读(395) 评论(0) 推荐(1) 编辑
该文被密码保护。 阅读全文
posted @ 2009-02-17 11:48 谭志宇 阅读(7) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; vector::iterator find(vector& source, int num) { vector::iterator begen = source.begin(); vector::iterator end = source.end(); while (begen != end) { ... 阅读全文
posted @ 2009-02-16 11:55 谭志宇 阅读(147) 评论(0) 推荐(0) 编辑
摘要: #include #include char* strcat(char* a, const char* b) { assert(a != NULL && b != NULL); char * str = a; while ( *str++ != '\0' ) NULL; str--; while ( (*str++ = *b++ ) != '\0') NUL... 阅读全文
posted @ 2009-01-22 12:36 谭志宇 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1:C和C++有什么区别: C++支持面向对象的编程,同时兼容C语言的面向过程编程 2:VB和C++有什么区别: VB是一门基于对象语言,有对象和类的概念,但是对于继承、多态实现的不好 3:VC和C++有什么区别: VC可以看成是C++加上MFC基础类库的组合 4:声明一个引用是需要注意什么,函数返回引用时需... 阅读全文
posted @ 2009-01-22 11:26 谭志宇 阅读(408) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std; int fun(int a) { return a; } typedef int(*funname)(int a); //对照DELPHI // type // funname = function(a: integer): int; // //函数指针数组 //typedef // int(*funarray[3]... 阅读全文
posted @ 2009-01-21 23:28 谭志宇 阅读(226) 评论(0) 推荐(0) 编辑
摘要: #include #include using namespace std; int main() { char *src = "hello world"; char * dest = NULL; int len = strlen(src); //cout using namespace std; int main() { char *src = "hello wor... 阅读全文
posted @ 2009-01-20 03:42 谭志宇 阅读(444) 评论(1) 推荐(0) 编辑