Topic: Arrays hang system?!


Author: rick@crash.cts.com (Rick Stout)
Date: 13 Jan 94 07:27:15 PST
Raw View
Hi,
Can someone please tell me why the following program hangs my
system?  I'm using Borland C++ 3.1.

It seems to do what I expect, but after it runs, it completely
hangs my system.  I've tried to figure it out, but haven't been
able to.

Thanks!
-Rick
-----------------------------------------------------------------------
#include <iostream.h>
#include <array.h>
#include <strng.h>
#include <assoc.h>

main()
{
 Array a(5, 0, 2);

 String *s1 = new String("a string");
 String *s2 = new String("another string");
 Association *a1 = new Association(*s1, *s2);

 a.add(*s1);
 a.add(*s2);
 a.add(*a1);

 cout << "second element is " << a[1] << endl;

 return(0);
}
-----------------------------------------------------------------------
-Rick Stout
(rick@cts.com)