10-25-06 12:18 PM
Wes wrote:
> On Thu, 19 Oct 2006 13:24:22 -0400, "T.M. Sommers" <tms@nj.net> wrote:
>
> How do you mean? If I use constant strings I won't be able to change
> them will I?
I meant the numbers specifying the sizes of the arrays. It is
better to do something like:
const int ARRAY_SIZE = 32;
if you absolutely have to use an array. But usually you should
be using std::string.
> Also, some of the functions I'm using require char*s
> (most importantly, read and write).
If you need a fixed-size buffer, then an array might be appropriate.
>
> Originally, the line was "enc.write(Encrypt(buffer), 32);", giving
> write() its pointer directly from the Encrypt function. However, the
> problem still existed. Does that still leak memory? If so, how should
> I rewrite that portion to not leak memory?
It could leak, depending on how it is implemented. How to fix it
will also depend on the implementation.
>
> How do you mean? What is 'gcount'?
istream::gcount() returns the number of characters read in the
last unformatted read operation.
--
Thomas M. Sommers -- tms@nj.net -- AB2SB
[ Post a follow-up to this message ]
|