当前位置:网站首页>STL string input / output overload 2
STL string input / output overload 2
2022-07-19 11:50:00 【joker_ 0030】
1、 Custom header file (Mystring.h)
//#pragma once
#ifndef _MYSTRING
#define _MYSTRING
#include<iostream>
using namespace std;
class stu
{
private:
// String first address
char* m_str;
// The number of strings
size_t m_l;
public:
stu();// No arguments structure .
stu(size_t length ,char ch);// take length Characters ch, Assign into object .
stu(const char* str);// Initialize objects with strings
stu(const char* str,size_t length);// Use one character before length Assign a length
stu(stu& str,size_t index,size_t length);// Copy the middle string of another object into the current object
stu(const stu& str);// Copy structure
public:
// Get the first address of the string .
const char* c_str() const;
// Get the number of characters of the string .
const size_t size() const;
// Set the number of characters .
void s_l(size_t length);
// Set the string content .
char* &GetMstr();
public:
// Destructor
~stu();
public:
// Output overload
friend ostream& operator <<(ostream& os, stu& str);
// Input overload
friend istream& operator >>(istream& is, stu& str);
};
// Output overload
ostream& operator <<(ostream& os, stu& str);
// Input overload
istream& operator >>(istream& is, stu& str);
#endif
边栏推荐
- 公网连接MySQL实例的解决方案
- A current List of AWESOME Qt and qml
- Automated graphical interface library pyautogui
- 百度文档翻译api
- A summary of C language pointer
- Three. JS basic element usage
- Antd form setting array fields
- Leetcode 1310. 子数组异或查询
- [unity technology accumulation] realize the mouse line drawing function &linerenderer
- High performance IO framework library libevent (III): overview of libevent framework functions
猜你喜欢

Leetcode 1252. Number of odd value cells

Leetcode skimming -- find and minimum k-pair number 373 medium

Lychee sound quality high fidelity AI noise reduction technology sharing

03-1、内联函数、auto关键字、typeid、nullptr

开发那些事儿:如何解决RK芯片视频处理编解码耗时很长的问题?

2022 National latest fire-fighting facility operator (intermediate fire-fighting facility operator) simulation test questions and answers

Leetcode 1328. 破坏回文串(可以,已解决)
![[multithreading] detailed explanation of JUC (callable interface, renntrantlock, semaphore, countdownlatch), thread safe set interview questions](/img/3a/b0bdf66e11e66234a222d977fd933c.png)
[multithreading] detailed explanation of JUC (callable interface, renntrantlock, semaphore, countdownlatch), thread safe set interview questions

Round table record: fireside dialogue -- how to realize innovation in Web3

STC8H开发(十四): I2C驱动RX8025T高精度实时时钟芯片
随机推荐
SQL union operator
Leetcode 1310. 子数组异或查询
Robot development -- common simulation software tools
Delegate parents and other loaders
Hello JSON Schema
TiKV 线程池性能调优
Redis分布式緩存-Redis集群
TCP拥塞控制详解 | 7. 超越TCP
夢想CMS 前臺搜索SQL注入
jconsole线程面板中的阻塞总数和等待总数(转)
Lychee sound quality high fidelity AI noise reduction technology sharing
Wechat applet cloud development 1 - Database
Tiflash performance tuning
[vulnhub range] prime:1 record of shooting process
[binomial tree] the power of the button cattle customers must brush questions
【PostgreSQL 】PostgreSQL 15对distinct的优化
QT -- excellent open source project
Research on Wenhua commodity index
Learning outline of the column "MySQL DBA's magic road"
Developing those things: how to solve the problem of long-time encoding and decoding of RK chip video processing?