VirtualBox

source: vbox/trunk/src/libs/zlib-1.2.6/contrib/iostream2/zstream_test.cpp@ 57415

最後變更 在這個檔案從57415是 40354,由 vboxsync 提交於 13 年 前

libs/zlib-1.2.6: fix OSE

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 711 位元組
 
1#include "zstream.h"
2#include <math.h>
3#include <stdlib.h>
4#include <iomanip.h>
5
6void main() {
7 char h[256] = "Hello";
8 char* g = "Goodbye";
9 ozstream out("temp.gz");
10 out < "This works well" < h < g;
11 out.close();
12
13 izstream in("temp.gz"); // read it back
14 char *x = read_string(in), *y = new char[256], z[256];
15 in > y > z;
16 in.close();
17 cout << x << endl << y << endl << z << endl;
18
19 out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results
20 out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl;
21 out << z << endl << y << endl << x << endl;
22 out << 1.1234567890123456789 << endl;
23
24 delete[] x; delete[] y;
25}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette