// File: des03.C // // The dangers of destructors, part 3 // // A better way to invoke the alternate constructor. #include #include #include "record.h" void foo(Record T) { Record R(2, 'r') ; // another way to call alternate constructor printf("\nIdentify T: ") ; T.id() ; printf("\nIdentify R: ") ; R.id() ; } main() { Record S(1, 's') ; // another way to call alternate constructor printf("Identify S: ") ; S.id() ; printf("Calling foo\n") ; foo(S) ; printf("Returned from foo\n") ; printf("\n\nEnd of main()\n\n") ; }