面试题系列(7)

84.将文字转为数字:atoi,atof ;将数字转为文本:sprintf
85.虚函数:virtual在基类内部增加1条指针变量(指向多个函数地址的指针数组的地址)
86.加强记忆:MFC: CList  CArray CString  CMap(哈希表)//MFC集合类:数据结构(算法流程)
C++STL标准模板库   std: list  vector string    map(二叉树)//通用容器类,面试时考察调用方式(循环、遍历删除查找)
CString      string
GetLength  size
substr        Mid

CString:从对象中取出指针:opeartor const char*
string:从对象中取出指针:const char*c_str( );
由指针到对象:构造函数
通用:+= + =
default:缺省构造(无参数构造)
basic_string( );
copy:拷贝构造
basic_string(const basic_string& str);
substring:部分提取(截断)
basic_string(const basic_string& str,size_type pos,size_type len=npos,const allocator_type& alloc=allocator_type( ));
from c-string(4):由指针到对象
basic_string(const charT* s,const allocator_type& alloc=allocator_type( ));
from sequence(5):从指针截断
basic_string(const charT*s,size_type n,const allocator_type& alloc=allocator_type( ));
fill(6):填充
basic_string(size_type n,charT c,const allocator_type&alloc=allocator_type( ));
fill(7):区间
template<class InputIterator>
     basic_string(InputIterator first,InputIterator last,
const allocator_type&alloc=allocator_type());
88.string中没有类型转化:(const char *),可以用str.c_str( ) 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值