Wrox Programmer Forums
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 28th, 2008, 12:37 PM
Registered User
 
Join Date: Apr 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Prevent memory leaks....

Hi there....

somebody could help me on how to change the string-length of an array of char to prevent memory leaks even if/when someone throws an exception?


Thanks for any reply......



http://www.hiredpower.com/ - Personal Recovery Assistant.
Reply With Quote
  #2 (permalink)  
Old July 3rd, 2008, 07:17 AM
Registered User
 
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How about using a char* instead of an array.

Another Option would be the usage of the string class.


Reply With Quote
  #3 (permalink)  
Old July 19th, 2008, 09:11 PM
Authorized User
 
Join Date: May 2007
Posts: 28
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to Peter_APIIT
Default

Why don't you use vector for better memory management ?

Linux is the best OS in the world.
Reply With Quote
The Following User Says Thank You to Peter_APIIT For This Useful Post:
StarDrago (November 17th, 2011)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory leaks(CRTDBG_MAP_ALLOC) Avihay Visual C++ 2 November 17th, 2011 01:48 PM
How to Prevent IE alert message ? Master123 Pro Java 2 September 1st, 2007 10:29 AM
prevent unicode as username? keyvanjan Classic ASP Basics 1 May 26th, 2006 05:59 PM
Prevent Submit Twice Joeboy General .NET 7 September 1st, 2004 10:12 AM
"Prevent User " javauniverse Pro VB Databases 3 January 9th, 2004 05:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.