D
deepakvsoni
what is the size of an class with not data members?
ex:
class A {
};
also
sizeof ?
class A{
int f(){
cout<<"Hello";
}
};
ex:
class A {
};
also
sizeof ?
class A{
int f(){
cout<<"Hello";
}
};
what is the size of an class with not data members?
ex:
class A {
};
also
sizeof ?
class A{
int f(){
cout<<"Hello";
}
};
Usually 1. Why don't you try it?
i've tried it... but why is it 1? Is it just for memory allocation so
that no two objects are allocated the same space?
Yes, among other considerations.- Hide quoted text -
- Show quoted text -
i've tried it... but why is it 1? Is it just for memory allocation so
that no two objects are allocated the same space?
so you mean to say the actual size of object is 0 but it is allocated
atleast 1 byte..
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.