// File: des05.C // // The dangers of destructors, part 5 // // Problems with using objects with dynamically allocated members. #include #include #include "record2.h" void foo(Record T) { Record R = Record("R"); printf("\nIdentify T: ") ; T.id() ; printf("\nIdentify R: ") ; R.id() ; } main() { Record S = Record("S") ; printf("Identify S: ") ; S.id() ; printf("Calling foo\n") ; foo(S) ; printf("Returned from foo\n") ; printf("\n\nEnd of main()\n\n") ; }