Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > char * memory l...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 37 Topic 43302 of 48020
Post > Topic >>

char * memory leak

by Travis <travis.bowers@[EMAIL PROTECTED] > Feb 13, 2008 at 04:26 PM

Quick question, how is a char * different than any other pointer? I've
never had this really elaborated.

Furthermore, is there a memory leak here (note this is just an example
not an actual implementation I'm using).

// name is an attribute of MyClass
void MyClass::SetName(char *n)
{
     char *newName = n;

     if ( SetToDefault == true )
     {
          newName = new char [7];


}
 




 37 Posts in Topic:
char * memory leak
Travis <travis.bowers@  2008-02-13 16:26:03 
Re: char * memory leak
Travis <travis.bowers@  2008-02-13 16:29:38 
Re: char * memory leak
"Default User"   2008-02-14 00:39:58 
Re: char * memory leak
"Daniel T." <  2008-02-13 20:41:22 
Re: char * memory leak
"Default User"   2008-02-14 00:33:44 
Re: char * memory leak
Travis <travis.bowers@  2008-02-13 17:09:09 
Re: char * memory leak
"Default User"   2008-02-14 01:19:25 
Re: char * memory leak
"Daniel T." <  2008-02-13 20:58:10 
Re: char * memory leak
"Daniel T." <  2008-02-13 20:19:22 
Re: char * memory leak
Eric <xingshi8000@[EMA  2008-02-13 17:54:15 
Re: char * memory leak
"Daniel T." <  2008-02-13 21:13:34 
Re: char * memory leak
"Alf P. Steinbach&qu  2008-02-14 03:09:20 
Re: char * memory leak
"Default User"   2008-02-14 16:57:34 
Re: char * memory leak
"Alf P. Steinbach&qu  2008-02-14 23:39:31 
Re: char * memory leak
"Default User"   2008-02-14 23:56:47 
Re: char * memory leak
"Alf P. Steinbach&qu  2008-02-15 04:03:35 
Re: char * memory leak
Kai-Uwe Bux <jkherciue  2008-02-14 23:31:09 
Re: char * memory leak
"Alf P. Steinbach&qu  2008-02-15 05:48:41 
Re: char * memory leak
Kai-Uwe Bux <jkherciue  2008-02-15 00:05:46 
Re: char * memory leak
"Default User"   2008-02-15 17:02:32 
Re: char * memory leak
"Alf P. Steinbach&qu  2008-02-15 21:15:22 
Re: char * memory leak
"Default User"   2008-02-15 20:27:30 
Re: char * memory leak
"Alf P. Steinbach&qu  2008-02-15 21:39:09 
Re: char * memory leak
"Default User"   2008-02-15 22:01:23 
Re: char * memory leak
"Daniel T." <  2008-02-15 19:54:56 
Re: char * memory leak
"Default User"   2008-02-16 01:18:50 
Re: char * memory leak
"Alf P. Steinbach&qu  2008-02-16 03:40:26 
Re: char * memory leak
"Default User"   2008-02-17 07:30:45 
Re: char * memory leak
Kai-Uwe Bux <jkherciue  2008-02-17 02:59:28 
Re: char * memory leak
Eric <xingshi8000@[EMA  2008-02-13 18:17:29 
Re: char * memory leak
"Daniel T." <  2008-02-13 21:59:02 
Re: char * memory leak
James Kanze <james.kan  2008-02-14 03:31:50 
Re: char * memory leak
"Daniel T." <  2008-02-14 11:22:10 
Re: char * memory leak
Tobias <google@[EMAIL   2008-02-14 13:42:48 
Re: char * memory leak
Tobias <google@[EMAIL   2008-02-15 00:21:13 
Re: char * memory leak
"Alf P. Steinbach&qu  2008-02-15 09:37:31 
Re: char * memory leak
"Daniel T." <  2008-02-16 07:59:41 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 8:41:40 CDT 2008.