C和C++编程和学习文档
C和C++编程和学习文档
1 :指针变量名称以p为首字符,这是程序员通常在定义指针时的一个习惯
2 :har * p; (int *)p 把p强制转换为int型
3.1 :指针的问题:指针应用时最好给予定义(初始化)这样可以保证指针的指向是程序员自己能够把握的。
3.2 :指针的越界,这恐怕是最难查出的吧!
3.3 :指针的局部变量问题。局部的指针变量会被程序自动释放,若程序员引用此类指针就会出错。2007-9-1
4.二维指针的应用实例:
#include <stdio.h>
#include <string.h>
void sort(char (*client)[10]);
void main()
{
int temp;
char client[3][10];
char (*pClient)[10] = NULL;
for( temp = 0; temp < 3; temp++ )
{
gets(client[temp]);
}
pClient = client;
sort(pClient);
for( temp = 0; temp < 3; temp++ )
{
puts(*(pClient + temp));
}
}
void sort(char (*client)[10])
{
//冒泡算法的明了写法
int temp1, temp2;
&n
相关文档:
assert
函数名: assert
功 能: 测试一个条件并可能使程序终止
用 法: void assert(int test);
程序例:
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
struct ITEM {
int&n ......
├—WINDOWS
│ ├—system32(存放Windows的系统文件和硬件驱动程序)
│ │ ├—config(用户配置信息和密码信息)
│ │ │ └—systemprofile(系统配置信息,用于恢复系统)
│ │ ├—drivers(用来存放硬件驱动文件,不建议删除)
│ │ ├—spool(用来存放系统打印文件。 ......
本文包括大部分C标准库函数,但没有列出一些用途有限的函数以及某些可以简单的从其他函数合成的函数,也没有包含多字节和本地化函数。
标准库中的各个函数、类型以及宏分别在以下标准头文件中说明:
<assert.h> <float.h> <math.h> <stdarg.h> <stdlib.h>
<ctype.h> <limits.h& ......
原文链接:http://blog.csdn.net/sytstarac/archive/2009/08/05/4411519.aspx
编译器:vc++6.0(因为此种实现依赖编译器处理)
此处只简要叙述一下机制。并附部分关键指令序列。
准备:
1,关于EBP:称做栈基址指针。为什么这样说呢?我们先来看看函数调用的过程:
参数从右到左压栈。
call指令执行,该指令将导致EIP压 ......