cannam@128: #include "zstream.h" cannam@128: #include cannam@128: #include cannam@128: #include cannam@128: cannam@128: void main() { cannam@128: char h[256] = "Hello"; cannam@128: char* g = "Goodbye"; cannam@128: ozstream out("temp.gz"); cannam@128: out < "This works well" < h < g; cannam@128: out.close(); cannam@128: cannam@128: izstream in("temp.gz"); // read it back cannam@128: char *x = read_string(in), *y = new char[256], z[256]; cannam@128: in > y > z; cannam@128: in.close(); cannam@128: cout << x << endl << y << endl << z << endl; cannam@128: cannam@128: out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results cannam@128: out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; cannam@128: out << z << endl << y << endl << x << endl; cannam@128: out << 1.1234567890123456789 << endl; cannam@128: cannam@128: delete[] x; delete[] y; cannam@128: }