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

Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.

1113


What is endianness?

1152


Can we run c program in turbo c++?

1131


What is an overflow error?

1156


What are the two types of comments, and how do they differ?

1211


What operator is used to access a struct through a pointer a) >> b) -> c) *

1164


What is the exit function in c++?

1029


How can I learn c++ easily?

1139


List the issue that the auto_ptr object handles?

1076


What is constructor and destructor in c++?

1170


Can a function take variable length arguments, if yes, how?

1073


Can constructor be private in c++?

1087


Which field is used in c++?

1152


What is the object serialization?

1207


What is the use of map in c++?

1194