it would be size of int.
On Jul 7, 10:34 am, "oppilas ." wrote:
> Ok. So for differentiating objects, we have size 1. What will be size of
> following class:-
> class A{
> int z;};
>
> How does different objects gets differentiated in above case?
>
>
>
>
>
>
>
> On Wed, Jul 6, 2011 at 2:24 P
while runnin same code in .cpp format gives 1
On Thu, Jul 7, 2011 at 12:19 AM, sanchit mittal wrote:
> Run dis in saving the same in .C format
> m getting 0...:)
>
> #include
> #include
>
> struct empty{};
>
> int main()
> {
>struct empty e;
>int x=sizeof(e);
> printf("%d",x);
> getc
Run dis in saving the same in .C format
m getting 0...:)
#include
#include
struct empty{};
int main()
{
struct empty e;
int x=sizeof(e);
printf("%d",x);
getch();
return 0;
}
On Wed, Jul 6, 2011 at 11:58 PM, shiv narayan wrote:
> hey i am getting size of empty struct 1.
> check my code
hey i am getting size of empty struct 1.
check my code
#include
#include
using namespace std;
struct empty{};
int main()
{
empty e;
int x=sizeof(e);
cout< wrote:
> @piyush:
> No,one can declare the variable of empty struct and access its address via
> pointer. So, when you are accessing a