#include <iostream>
#include <cstring>
#include <string>
using namespace std; class MySTLString
{
public:
MySTLString();
MySTLString(int count, char ch);
MySTLString(const char* s);
const char& front() const;
const char& back() const;
int size() const; private:
char* data_;
}; MySTLString :: MySTLString() : data_(new char[1])
{
*data_ = '\0';
} MySTLString :: MySTLString(const char* s) : data_(new char[strlen(s) + 1])
{
strcpy(data_, s);
} const char& MySTLString::front() const
{
return data_[0];
} int MySTLString::size() const
{
return strlen(data_);
} int main(void)
{
MySTLString str("Hello");
cout << str.front() << endl;
cout << str.size()<<endl; return 0;
}

  

最新文章

  1. codeforces problem 140E New Year Garland
  2. Myth – 支持变量和数学函数的 CSS 预处理器
  3. python抓取网站URL小工具
  4. ACM/ICPC 之 并查集-食物链(POJ1182)
  5. DX使用texconv工具批处理dds格式图片
  6. JAVA多线程实现的四种方式
  7. 记一个PowerShell的方法调用 --ResolveWindowsPrincipal
  8. 周赛-Colored Sticks 分类: 比赛 2015-08-02 09:33 7人阅读 评论(0) 收藏
  9. 【Reporting Services 报表开发】— 矩阵的使用
  10. None
  11. 关闭Sql Assistant的自动智能命名别名的问题
  12. 使用WiX Toolset创建.NET程序发布Bootstrapper(安装策略管理)(二)——自定义安装
  13. Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
  14. 01. Overview Redis 关于Redis
  15. SQLI DUMB SERIES-20
  16. 初步了解three.js
  17. 论文阅读笔记二十五:Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition(SPPNet CVPR2014)
  18. python基础之从认识python到python的使用
  19. composer require 指定版本
  20. mysql 安装成功以及第一次安装成功初始化密码操作

热门文章

  1. PHP实例:使用PHPExcel导入Excel2003文档和Excel2007文档到MySQL数据库中
  2. Day3上
  3. Handler: Service中使用Toast
  4. spring boot 启动报错No active profile set, falling back to default profiles
  5. springboot 学习笔记(七)
  6. 表格&lt;table&gt;
  7. VC使用编译时间作为版本号
  8. SpringBoot的快速构建
  9. Azure School,让系统化学习回归一站式的简单体验
  10. mysqlbench使用