c++应注意的小问题

1,判断字符串非空时

char *str;

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

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

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

posted @ 2011-11-30 20:14  白婷  阅读(103)  评论(0编辑  收藏  举报