⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 string.h

📁 比较简陋的数据库应用,唯一能看的就是对ODBC的封装...
💻 H
字号:
#ifndef _String_H
#define _String_H

#define MAX_STRING 200

#include <iostream>



class String
{
public:
	String();
	String(const char* astr);
	String(const String& astr);
	String(const char ch, int num = 1);
	String(int num);
	String& operator=(const String& astr);
	String& operator=(const char ch);
	~String();
	
	String& operator+=(const String& astr);
	bool operator==(const String& astr) const;
	bool operator!=(const String& astr) const;
	char getChar(int i);
	bool empty() const;
	int getlenth() const;
	int reGetlenth();
	int find(char ch) const;
	String getSub(int beg, int end);
	void Set(int len);

	int intoInt();
	double intoDouble();

	operator unsigned char*();
	
	friend std::ostream& operator<<(std::ostream& out, const String& astr);
	friend std::istream& operator>>(std::istream& in, String& astr);
	
private:
	int lenth;
	unsigned char* str;
};

String operator+(const String& lstr, const String& rstr);
String intoString(int i);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -