Hi everbody,My below program is running successfully ,but at end it is displaying Null Pointer Assignment as output. Why ???

#include #include int main(){     
  float far **ptr; /* For 2-D array dynamic allocation*/   
             register int i,j;           
     ptr=(float far**)calloc(256,sizeof(ptr));
                if(ptr==NULL)               {     
     printf("\n No Memory! ");     
      return 0;       }        
           for(i=0;i

Hi everbody,My below program is running successfully ,but at end it is displaying Null Pointer Assignment as output. Why ???

#include #include int main(){ float far **ptr; /* For 2-D array dynamic allocation*/ register int i,j; ptr=(float far**)calloc(256,sizeof(ptr)); if(ptr==NULL) { printf("\n No Memory! "); return 0; } for(i=0;i

Put your code inside code tags. Read post no 7 in http://www.daniweb.com/techtalkforums/thread54763.html"]this thread.

commented: Spreading some reputation back (Anonymusius) :P +1

dsraju, there's no such thing as far in ANSI C. I guess you are still using ancient compilers. It's time to move ahead.

Yes, i think maybe you are wokring on a 16 bit compiler like Turbo C. Move on to some newcompiler and try your code then. If still error persists post here.
Look for the list of free IDE and compilers here.
http://www.daniweb.com/techtalkforums/thread50370.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.