Nicholas Blatter wrote:
> I have, but this project requires the use of cstrings and their
> related functions.  Additionally it's good to try and get back into
> shape as far as memory management goes.  I've been somewhat spoiled by
> Java/PHP/C# and want to get my "sea legs" back :)

Yes I recognized your "words = new char[5]" immediately as a javaism!

Even if you were using strcpy, the correct c++ or c form is going to 
simply be a static (stack) declaration:

char words[5]

For something this small there is no reason to allocate it on the heap, 
especially if the length is bound like that.

Michael


> 
> Thanks again.
> 
> Nick
> --------------------
> BYU Unix Users Group 
> http://uug.byu.edu/ 
> 
> The opinions expressed in this message are the responsibility of their
> author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
> ___________________________________________________________________
> List Info: http://uug.byu.edu/mailman/listinfo/uug-list
> 

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to