当前位置:网站首页>Stream function compatible with cstring--cmyfile
Stream function compatible with cstring--cmyfile
2022-06-10 08:00:00 【Fantastical Yu ruiyin】
explain
This part of the program is not very useful , Just let C++ The file I / O program in is compatible with CString, Prior to Excel and Txt Used in reading and writing programs .
Program
//Cmyfile.h
#pragma once
#include <fstream>
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
// It's no use , Pure fragmentation is to make stream functions compatible CString
class Cmyfile
{
public:Cmyfile() {
}
friend ifstream & operator>>(ifstream & debug, CString str); //str Cannot be a reference , The reason is not clear
friend ofstream & operator<<(ofstream & debug, CString & str); //str Must be a reference
};
//Cmyfile.cpp
#include "pch.h"
#include "Cmyfile.h"
ifstream & operator>>(ifstream & debug, CString str)
{
// TODO: Insert... Here return sentence
debug >> str.GetBuffer();
return debug;
}
ofstream & operator<<(ofstream & debug, CString & str)
{
// TODO: Insert... Here return sentence
debug << str.GetBuffer();
return debug;
}
Last
nothing
边栏推荐
- PS 2022 installation failure error code 182 solution
- WPF data binding (III)
- 利用二叉树的前中序遍历序列再次创建二叉树
- PT kill of MySQL
- Projector integrated smart phone 2022 Global Industry Analysis Report
- What brand is a cheap Bluetooth headset? Four cheap and easy-to-use Bluetooth headsets on the digital control panel
- 04MySQL索引原理分析-1
- Basic exercise rectangular area intersection
- putty里中文显示为框框和乱码无法显示中文解决
- 关于发布《深圳市培育发展生物医药产业集群行动计划(2022-2025年)》的通知
猜你喜欢

Diode, triode

markdown md 文件编辑器测试使用说明

R language data processing: tidyr package learning

平价蓝牙耳机什么牌子好?数码控盘点四大平价好用的蓝牙耳机

What if online gambling can't be withdrawn?

Create RT thread software simulation project and write RT thread kernel

YOLO-SLAM: A semantic SLAM system towards dynamic environment with geometric constraint

电阻、电容、电感

Redis数据类型之list和set以及sorted_set排序

Intelligently merge videos, randomly merge video covers, and preset new titles
随机推荐
How to make sql-mode=“NO_ENGINE_SUBSTITUTION” permanent in MySQL my. cnf
MySql 查看数据库信息常用命令
数据库主键用uuid好还是雪花或者其他什么比较好呢
Basic exercise decimal to hexadecimal
Improvement of sequencing in Engineering
The second match of Heilongjiang Vocational College (synchronized match)
Cache the log in the queue mode, display the log in the queue and display it in different colors (c)
3 zk的选举机制
格式化日期和文本长度的过滤器
A practice of encrypting server 3D model resources
Notice on the issuance of Shenzhen action plan for cultivating and developing biomedical industry clusters (2022-2025)
「动态规划」0/1背包问题
7-1 intersection of two ordered linked list sequences (20 points)
关于发布《深圳市培育发展生物医药产业集群行动计划(2022-2025年)》的通知
工程上对排序的改进
自动薅羊毛技术方案总结
浏览器中如何使用 module export import: Uncaught SyntaxError: Cannot use import statement outside a module 问题
Resistance, capacitance, inductance
[dry goods] typescript: extensions, infer and DVA type
Liste et ensemble des types de données redis et triés Définir le tri