1,判断字符串非空时

char *str;

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

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

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

相关文章: