Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - New and Delete in C++: (3 Items)
   
New and Delete in C++  
hi,

I am using new for memory allocation in c++, after allocating i am properly releasing the memory. For using this i have 
included <new>header file.The code is as below

 	int *p1 ;
 	
 	*p1 = new (nothrow)datCtlMode;
 	if(p1==0)
 		Flag =1;
 	else
 		Flag = 0;
 	delete datCtlMode;

With this procedure i am getting error as Parse error.If anybody have any idea please guide me...
RE: New and Delete in C++  

> -----Original Message-----
> From: Sreesha AG [mailto:community-noreply@qnx.com]
> Sent: December-16-08 5:30 AM
> To: general-ide
> Subject: New and Delete in C++
> 
> hi,
> 
> I am using new for memory allocation in c++, after allocating i am
> properly releasing the memory. For using this i have included
> <new>header file.The code is as below
> 
>  	int *p1 ;
> 
>  	*p1 = new (nothrow)datCtlMode;
>  	if(p1==0)
>  		Flag =1;
>  	else
>  		Flag = 0;
>  	delete datCtlMode;


  	int *p1 ;
 
  	p1 = new (std::nothrow) datCtlMode;
  	if(p1==0)
  		Flag =1;
  	else
  		Flag = 0;
  	delete p1;


> With this procedure i am getting error as Parse error.If anybody have
> any idea please guide me...
> 
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post18680
> 
Re: RE: New and Delete in C++  
thank you for the answer