1*c87b03e5Sespie // GROUPS passed conversions 2*c87b03e5Sespie #include <cstdio> 3*c87b03e5Sespie #include <cstdlib> 4*c87b03e5Sespie #include <cstring> 5*c87b03e5Sespie #include <iostream> 6*c87b03e5Sespie #include <fstream> 7*c87b03e5Sespie 8*c87b03e5Sespie class cvec { 9*c87b03e5Sespie public: ~cvec()10*c87b03e5Sespie ~cvec(){ delete s; } cvec(const char * x)11*c87b03e5Sespie cvec(const char*x) { s = new char[std::strlen(x)+1]; std::strcpy(s, x); } cvec(const cvec & c)12*c87b03e5Sespie cvec(const cvec& c) { s = new char[std::strlen(c.s)+1]; std::strcpy(s, c.s); } 13*c87b03e5Sespie operator const char*() { return s; } 14*c87b03e5Sespie private: 15*c87b03e5Sespie char *s; 16*c87b03e5Sespie }; 17*c87b03e5Sespie 18*c87b03e5Sespie cvec B(const char * a)19*c87b03e5SespieB(const char* a) 20*c87b03e5Sespie { 21*c87b03e5Sespie return a; 22*c87b03e5Sespie } 23*c87b03e5Sespie 24*c87b03e5Sespie void A(const char * s)25*c87b03e5SespieA(const char* s) 26*c87b03e5Sespie { 27*c87b03e5Sespie // s still ok here 28*c87b03e5Sespie std::ifstream inf(s); 29*c87b03e5Sespie if (std::strncmp ("aaa", s, 3)) 30*c87b03e5Sespie { 31*c87b03e5Sespie std::printf ("FAIL\n"); 32*c87b03e5Sespie std::exit (1); 33*c87b03e5Sespie } 34*c87b03e5Sespie else 35*c87b03e5Sespie std::printf ("PASS\n"); 36*c87b03e5Sespie } 37*c87b03e5Sespie main()38*c87b03e5Sespieint main() 39*c87b03e5Sespie { 40*c87b03e5Sespie A(B("aaa")); 41*c87b03e5Sespie } 42