Subject: Re: Memory leaks
From: Martin Sevior (msevior@mccubbin.ph.unimelb.edu.au)
Date: Wed Jun 20 2001 - 08:45:38 CDT
On Wed, 20 Jun 2001, [ISO-8859-1] Joaquín Cuenca Abela wrote:
>
> you will find that theory and experiments are much more heavily tied in
> CS
> than in physics (here there are not "disturbing" factors ;-)
>
> P.S.: Please please please, change all ocurrences of
>
> UT_String blah = "foo";
>
> by
>
> UT_String blah("foo");
>
> in the code. The first form will create a unneeded temp object (with
> the first
> form we should strcpy & memcpy the string, with the later we only need
> to strcpy
> the string).
>
Actually because of the scoping you've beautifully explained what we have
are lots of instances of
void foo(void)
{
UT_String me;
if(x)
{
me = "bar:";
}
else
{
me = "foo:";
}
me += "fred; ";
.
.
}
Cheers
Martin
This archive was generated by hypermail 2b25 : Wed Jun 20 2001 - 08:46:09 CDT