C常用函数
1. sizeof
sizeof返回占用的字节数,但数组作为参数传递时不能有效计算占用的字节数,需加参数指明占用的字节数
|

2. malloc realloc
头文件: stdlib.h
realloc后,申请空间比原来大,重新分配地址空间
|


3. memset
string.h
int column[MAX_N];
memset(column, 0, sizeof(int) * MAX_N);
4. 条件表达式
ax为0时,输出15
ax不为0时,输出6
|
sizeof返回占用的字节数,但数组作为参数传递时不能有效计算占用的字节数,需加参数指明占用的字节数
#include <stdio.h> |

头文件: stdlib.h
realloc后,申请空间比原来大,重新分配地址空间
#include <stdio.h> |


string.h
int column[MAX_N];
memset(column, 0, sizeof(int) * MAX_N);
ax为0时,输出15
ax不为0时,输出6
#include <stdio.h> |