Sunday, March 16.

Header Ads

Colorful+Black+Friday+Discount+Leaderboard+Ad

Comparison of Two Pointers

Muscle+Inc.+%25282%2529

Comparison%20of%20Two%20Pointers

 

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 प्राप्त नहीं किया जा सकता |
  • ·       आपस में किसी स्थिरांक से भाग नहीं दिया जा सकता | और
  • ·       आपस में किसी स्थिरांक से गुण नहीं किया जा सकता |


No comments

Post Top Ad

Post Bottom Ad