背景字体颜色
<span style="font-size:14px;">#include<stdio.h>
#include<windows.h>
int mian(){
system("cls"); //清屏
system("color fc"); //改背景颜色和字体颜色
Sleep(2000); //休眠2000毫秒
}</span>
退出当前程序
#include<stdio.h>
#include<stdlib.h>
int main(){
exit(0);
}
文件ini的写入和获得
GetPrivateProfileString(p1.username,"HP",game_player_property_HP,".\\player.ini");
//获得当前目录下的player.ini中的p1.username中的HP中的属性,获得的是字符型
GetPrivateProfileInt(p1.username,"HP",game_player_property_HP,".\\player.ini");
<pre name="code" class="html">//获得当前目录下的player.ini中的p1.username中的HP中的属性,获得的是整型
WritePrivateProfileString(p1.username,"HP",game_player_property_HP,".\\player.ini");<span style="font-size:14px;"></span><pre name="code" class="html"><pre name="code" class="html">//写入当前目录下的player.ini中的p1.username中的HP中的属性,写入的是字符型(如果当前数据是整形,需要强转为字符型)
itoa(i,stmp,10)
//强转,第一个为当前数据类型,第二个为要转换的数据类型,第三个为10进制转换