0

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
4
Contributors
3
Replies
5
Views
10 Years
Discussion Span
Last Post by ~s.o.s~
2

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.

Edited by pyTony: fixed formating

Votes + Comments
Spreading some reputation back (Anonymusius) :P
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.