//  File: des02.C
//
//  The dangers of destructors, part 2
//
//  Invoking the alternate constructor can cause problems.

#include <stdio.h>
#include <stdlib.h>
#include "record.h"


void foo(Record T) {
   Record R = Record(2, 'r');

   printf("\nIdentify T: ") ;
   T.id() ;

   printf("\nIdentify R: ") ;
   R.id() ;
}


main() {
   Record S = Record(1, 's') ;

   printf("Identify S: ") ;
   S.id() ;

   printf("Calling foo\n") ; 
   foo(S) ;
   printf("Returned from foo\n") ; 

   printf("\n\nEnd of main()\n\n") ;
}
