Dark Mode Logo (Optional)

Dark Mode Logo (Optional)

Comparison of Two Pointers



 

Comparison of Two Pointers

यदि किसी Array के एक ही Elements के दो Pointers हों तो उनका आपस में Comparison भी किया जा सकता है कि उन दोनों Pointers के Address समान हैं या नहीं | जैसे


#include<stdio.h>
main()
 {
   int j[4], *k, *l;
   k = &j[3];
   l = &j[j + 3];
   clrscr();
   
      if( k = = l)
      
         printf("\n Both Pointers Are Pointing the same Location");
         
else

         printf("\n Both Pointers Are Not Pointing the same Location");

getch();

}

ये बात हमेंशा ध्यान रखें कि कभी भी दो Pointer में Stored Addresses को

  • ·       आपस में जोड़ कर नया Address प्राप्त नहीं किया जा सकता |
  • ·       आपस में किसी स्थिरांक से भाग नहीं दिया जा सकता | और
  • ·       आपस में किसी स्थिरांक से गुण नहीं किया जा सकता |


You may like these posts:

No comments:

Post a Comment