MCU Null pointer

Discussion in 'General Electronics Chat' started by aamirali, Jun 19, 2012.

  1. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1


    Null pointer points to zero address, also in MCU zero address is special fuction register normally.. Don't they conflict with each other. If I define malloc function & MCU won't be able to allocate memory then malloc return null address,
    then what could be the problem.
     
  2. aamirali

    Thread Starter Member

    Feb 2, 2012
    415
    1
    help abt dis..........
     
  3. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    That is why you allways should check if ptr!=null after allocation. If you don´t do that you´re asking for trouble regardless of MCU or CPU you´re using.
     
Loading...