Dynamic Memory allocation checking

how to check whether dynamical memory allocation has succeeded or not

Page 1 of 1

2 Replies - 1540 Views - Last Post: 18 October 2010 - 06:52 AM Rate Topic: -----

#1 karthik.v  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 1
  • Joined: 18-October 10

Dynamic Memory allocation checking

Posted 18 October 2010 - 06:11 AM

hi..

please tell me how to check dynamical memory allocation has succeeded or not ?

Any help is greatly appreciated..

thanks in advance...
Is This A Good Question/Topic? -1
  • +

Replies To: Dynamic Memory allocation checking

#2 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5874
  • View blog
  • Posts: 12,752
  • Joined: 16-October 07

Re: Dynamic Memory allocation checking

Posted 18 October 2010 - 06:14 AM

You call malloc or new and assign the results to a pointer. If the pointer is null, you didn't get the memory you asked for.
Was This Post Helpful? 1
  • +
  • -

#3 Salem_c  Icon User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 1703
  • View blog
  • Posts: 3,262
  • Joined: 30-May 10

Re: Dynamic Memory allocation checking

Posted 18 October 2010 - 06:52 AM

STOP WASTING EVERYONES TIME!!!

http://forums.devshe...ing-754826.html

http://cboard.cprogr...ically-not.html

Choose carefully next time, and don't spam every forum you can find with the same trivial RTFM question.
http://www.catb.org/...ions.html#forum
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1