c++应注意的小问题

来源:互联网 发布:学点什么技术好 知乎 编辑:程序博客网 时间:2024/05/18 10:20

1,判断字符串非空时

char *str;

if(str!=NULL)//NULL全为大写

cout<<“not null!”<<endl;,

2,要用strlen和strcpy,strcat等函数时,要在头部增加#include<string.h>

原创粉丝点击