OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [zlib/] [contrib/] [iostream2/] [zstream_test.cpp] - Blame information for rev 849

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 745 jeremybenn
#include "zstream.h"
2
#include <math.h>
3
#include <stdlib.h>
4
#include <iomanip.h>
5
 
6
void 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
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.