#include<iostream>
using namespace std;
struct My_Class{
class My_struct{
int am_i_in_class_or_struct;
};
};
int main(){
cout<<sizeof(My_Class)<<endl;
cout<<sizeof(My_struct)<<endl;
cout<<sizeof(int);
}
Please Explain: when i executed the above program on Turbo C i got output:
1
2
2
Now shouldn't the size be same in each case, or at least My_Class should have the same or larger size than My_struct!!
If there are errors in the program please fix them if you can, or else ignore it and concentrate on the question at hand!
I dont trust Turbo C as such... but currently my VS 2008 keeps crashing due to my Ram going bad!