e2102.cpp
来自「游戏开发数据结构Data Structures for Game Program」· C++ 代码 · 共 39 行
CPP
39 行
// =======================================================
// Chapter 21, Example 2
// RLE Decompression
// =======================================================
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
#include <string.h>
#include "Array.h"
#include "RLE.h"
void main()
{
typedef unsigned char uchar;
Array<uchar> uncompressed( 1 );
RLE<uchar> compressed;
// filename
char dataname[80];
// get the file names
cout << "Enter data file name: ";
cin >> dataname;
// load the data
compressed.LoadData( dataname );
// decompress the data
compressed.Decompress( uncompressed );
// chop off the ending of the file name
dataname[ strlen(dataname) - 4 ] = 0;
uncompressed.WriteFile( dataname );
cout << "Decompressed to " << dataname << endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?