C++ 常用

来源:互联网 发布:sql distinct单个字段 编辑:程序博客网 时间:2024/06/18 10:59

去头去尾 

void remove_space(string& str){ 

string buff(str); 
char space = ' '; 
str.assign(buff.begin() + buff.find_first_not_of(space), 
buff.begin() + buff.find_last_not_of(space) + 1); 


把一个char a[20]清零,一定是 memset(a,0,20*sizeof(char));

http://baike.baidu.com/link?url=OPwRpCjTVRbH1d-4iS5L45F98j-uUmbXkfK4g9KlpbJW7_ddakP40UMcJ39ObOw6fc9U9__PVwIeQJWWAsxFWK

0 0