【c++】b_game1.1

增加了2个函数

安装法和1.0一样

b_game.h1.0在这里有

#ifndef SOMETHING_H
#define SOMETHING_H
#include<iostream>
#include<iomanip>
#include<string>
#include<cstdlib>
#include<ctime>
#include<windows.h>
#include<conio.h>
#include<fstream>
using namespace std;
struct cdhs//存档结构体 
{
	void out(int n, string name)//输出存档 
	{
		ofstream cd(&name[0]);
		cd << n;
		return;
	}
	void out(long long n, string name)
	{
		ofstream cd(&name[0]);
		cd << n;
		return;
	}
	void out(bool n, string name)
	{
		ofstream cd(&name[0]);
		cd << n;
		return;
	}
	void out(char n, string name)
	{
		ofstream cd(&name[0]);
		cd << n;
		return;
	}
	void out(string n, string name)
	{
		ofstream cd(&name[0]);
		cd << n;
		return;
	}//重载 



	void in(int& n, string name)//读入存档 
	{
		ifstream cd(&name[0]);
		cd >> n;
		return;
	}
	void in(long long& n, string name)
	{
		ifstream cd(&name[0]);
		cd >> n;
		return;
	}
	void in(bool& n, string name)
	{
		ifstream cd(&name[0]);
		cd >> n;
		return;
	}
	void in(char& n, string name)
	{
		ifstream cd(&name[0]);
		cd >> n;
		return;
	}
	void in(string& n, string name)
	{
		ifstream cd(&name[0]);
		cd >> n;
		return;
	}//重载 
};
//
//
//
//void bout(string n,long long s);//输出 
void ckbb();//查看当前b_game.h库版本信息 
void color(int c);//颜色 
void gs(long long h, long long l, string z);//格式 
void ycgb();//隐藏光标 
void ydgb(long long h, long long l);//移动光标 
// 
// 
// 
void bout(string n, long long s = 50)//输出 
{
	for (long long i = 0; i < n.size(); i++)
	{
		cout << n[i];
		Sleep(s);
	}
	return;
}
void ckbb()//查看当前b_game.h库版本信息 
{
	system("cls");
	cout << "库名:b_game.h\n";
	cout << "类型:拓展库\n";
	cout << "版本号:1.1\n";
	return;
}
void color(int c)//颜色 
{
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), c);
	return;
}
void gs(long long h, long long l, string z)//格式 
{
	for (long long i = 1; i <= h; i++)
		cout << "\n";
	for (long long i = 1; i <= l; i++)
		cout << " ";
	cout << z;
	return;
}
void ycgb()//隐藏光标 
{
	CONSOLE_CURSOR_INFO cursor;
	cursor.bVisible = FALSE;
	cursor.dwSize = sizeof(cursor);
	HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
	SetConsoleCursorInfo(handle, &cursor);
	return;
}
void ydgb(long long h, long long l)//移动光标 
{
	COORD pos = { l,h };
	HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
	SetConsoleCursorPosition(hOut, pos);
	return;
}
#endif

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值