1,判断字符串非空时
char *str;
if(str!=NULL)//NULL全为大写
cout<<“not null!”<<endl;,
2,要用strlen和strcpy,strcat等函数时,要在头部增加#include<string.h>
1,判断字符串非空时
char *str;
if(str!=NULL)//NULL全为大写
cout<<“not null!”<<endl;,
2,要用strlen和strcpy,strcat等函数时,要在头部增加#include<string.h>
转载于:https://www.cnblogs.com/baiting/archive/2011/11/30/5346407.html