#include<iostream.h> #include<conio.h> int main() { int a[2]={1,2}; cout<<sizeof(a)<<" "<<sizeof(&a)<<endl; cout<<a<<" "<<&a<<endl; cout<<a+1<<" "<<&a+1<<endl; getch(); }
It gives size of 'a' as 8 and '&a' as 4...which i hadnt expected.. and then a+1 is increasing just 4 while &a+1 is increasing 8 in respectively 'a' , '&a' ! why so?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/2pJRgmCClNcJ. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.