1*9573673dSchristos #include "zstream.h" 2*9573673dSchristos #include <math.h> 3*9573673dSchristos #include <stdlib.h> 4*9573673dSchristos #include <iomanip.h> 5*9573673dSchristos main()6*9573673dSchristosvoid main() { 7*9573673dSchristos char h[256] = "Hello"; 8*9573673dSchristos char* g = "Goodbye"; 9*9573673dSchristos ozstream out("temp.gz"); 10*9573673dSchristos out < "This works well" < h < g; 11*9573673dSchristos out.close(); 12*9573673dSchristos 13*9573673dSchristos izstream in("temp.gz"); // read it back 14*9573673dSchristos char *x = read_string(in), *y = new char[256], z[256]; 15*9573673dSchristos in > y > z; 16*9573673dSchristos in.close(); 17*9573673dSchristos cout << x << endl << y << endl << z << endl; 18*9573673dSchristos 19*9573673dSchristos out.open("temp.gz"); // try ascii output; zcat temp.gz to see the results 20*9573673dSchristos out << setw(50) << setfill('#') << setprecision(20) << x << endl << y << endl << z << endl; 21*9573673dSchristos out << z << endl << y << endl << x << endl; 22*9573673dSchristos out << 1.1234567890123456789 << endl; 23*9573673dSchristos 24*9573673dSchristos delete[] x; delete[] y; 25*9573673dSchristos } 26