摘要:
1、点击Visual Assist X Options2、选择ADvanced->suggestions,在右侧选择Edit VA Snippets3、以添加c++代码注释为例,在左侧的c++选项中,右键选择New,会生成一个名为Untitled的片段编译选项。编辑其中的属性即可,如下图:还有一个在vs中常用的插件是:viemu 阅读全文
摘要:
#include #include typedef struct node *link;struct node { int item; link next;};/* 初始化一个节点数为n的一个链表*/void init(link a, int n){ int i; for (a, i = 0; i next = malloc(sizeof(*a))); a->item = rand()%100; a->next = NULL; }}/* 遍历链表*/void traverse(link p){ while (p != NULL) ... 阅读全文
摘要:
#include #include typedef struct node *link;struct node { int item; link next;};link reverse(link x){ link r = NULL, y = x, t; while (y != NULL) { t = y->next; y->next = r; r = y; y = t; } return r;}int main(){ int i, N = 9; struct node head... 阅读全文
摘要:
前几天看到一篇有关调试方面的文章,个人觉得挺好。【转载】http://www.blogjava.net/tidelgl/archive/2008/08/19/223051.html这是我自己在学习时整理的,希望对大家有用.其中有几个部分的内容,如下: ※My Note 全部由我截图并参考资料进行说明,这其中有大量的内容是调试过程中体会总结才写的.有不当之处请大家更正. ※From 《Visual C++ Debugger》 这本书写得非常的不错,从里面截了一些有用的图,主要是强烈推荐大家阅读这本书. ※Debug Menu From MSDN 这是我从Visual C++ 6.0 MSDN . 阅读全文
摘要:
#include #include /*//以前的写法 int *p = 5;这个是一种错误的写法,p首先是一个指针变量 int *p,a; p = &a; *p = 5;p是一个指针,指向一个内存地址,你不指明p指向的位置,程序怎么会知道你要给哪块内存赋值呢?你可以申请一块堆空间给p,或者直接定义一个变量,让p指向该变量*/int foo(){ int *p; p = (int *)malloc(sizeof(int)); *p = 5; return *p;}int main(){ int i = foo(); printf("%... 阅读全文