http://www.cprogramming.com/tutorial/size_of_class_object.html
On 7/27/11, TUSHAR <[email protected]> wrote: > 1. > #include<iostream> > using namespace std; > class abc > { > int x; > static int y; > }; > main() > { > abc a; > cout<<sizeof(a); > cout<<sizeof(abc); > } > > why o/p is 4 4 ??????? > > > 2. > class abc > { }; > main() > { > abc ob; > cout<<sizeof(ob); > } > > why o/p is 1 ? > some say o/p may vary from os to os .....why ?? and what may be other > o/p s ? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- *Piyush Sinha* *IIIT, Allahabad* *+91-7483122727* * <https://www.facebook.com/profile.php?id=100000655377926> "NEVER SAY NEVER" * -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
