c++ - sizeof a pointer -


  int i = 0; Int * p = & amp; i; Std :: cout & lt; & lt; sizeof (i) & lt; & lt; "बनाम" & lt; sizeof (p) & lt; & lt; "\ n"; चार सी = '0'; Char * pc = & amp; c; Std :: cout & lt; & lt; sizeof (c) & lt; & lt; "बनाम" & lt; sizeof (pc) & lt; & lt; "\ n"; डबल डी = 0.123456789; डबल * पीडी = & amp; डी; Std :: cout & lt; & lt; sizeof (d) & lt; & lt; "बनाम" & lt; sizeof (pd) & lt; & lt; "\ n";   

क्यों एक सूचक का आकार हमेशा एक पूर्णांक के बराबर है जो 4 है?

क्योंकि एक पॉइंटर कितना मेमोरी है: 4 बाइट्स।

यदि यह 64-बिट अनुप्रयोग था, तो यह 8 लौटाएगा।

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -