Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Enterprise
Expertise: Beginner
Feb 1, 2001

MS Default Pointer Value


Don't forget that MS compiler initiates pointers with 0xCCCCCCCC value. In this case:
 
		void *p;

		... //do something here...

		if (p!=NULL) delete p; // Memory violation 

The right way void* p = NULL;

Or if (p!=NULL && p != 0xCCCCCCCC ) delete p;

Alex Laysha
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date