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