Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Which uses less memory?
a)
struct astruct
{
int x;
float y;
int v;
};

b)
union aunion
{
int x;
float v;
};

c)
char array[10];

Answer Posted / ranjeet garodia

Jaroosh u r right while calculating the size...
but if u take size of int as 2 then astruct size will be
2+4+2=8
array = 1*10= 10
so c is correct

if size of int is 4, then
struct size will be 4+4+4= 12
then a is correct.

Is This Answer Correct ?    1 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is else syntax in c++?

1133


If all is successful, what should main return a) 0 b) 1 c) void

980


What does ios :: app do in c++?

974


What is the difference between a template and a macro?

1008


What is double in c++?

1010


Describe private, protected and public?

1048


Why is c++ called oops?

1091


What is difference between array and vector in c++?

983


What are the benefits of oop in c++?

1140


Is c++ still in demand?

1114


Declare a class vehicle and make it an abstract data type.

930


Is swift better than c++?

902


Write a program which uses Command Line Arguments

1125


What do you mean by “this” pointer?

1041


Is string an object in c++?

1110