随笔分类 - C
关于cmp函数参数中的&符号
摘要:原文链接:https://blog.csdn.net/qie_wei/article/details/81135920 关于sort函数中的cmp函数有着不同的写法,以刚刚的整形元素比较为例还有人是这么写的: 1 bool cmp(const int &a, const int &b){ 2 ret
strlen( )和 sizeof( )的区别
摘要:原文链接:https://blog.csdn.net/lee514/article/details/82940859 strlen( )strlen( )求得的是字符串的长度 例如字符串 str[20]= {“abcd”}; strlen(str),结果为4 sizeof( )sizeof( )计算
struct和typedef struct的区别
摘要:转载来源:https://www.cnblogs.com/qyaizs/articles/2039101.html 分三块来讲述: 1 首先://注意在C和C++里不同 在C中定义一个结构体类型要用typedef: typedef struct Student { int a; }Stu; 于是在声