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...

let's take a code

struct FAQ
{
int a;
char b;
float c;
double d;
int a[10];
}*temp;

now explain me how the memory will be allocated for the
structure FAQ and what address will be in the structure
pointer (temp)....................

Answer Posted / vrushali

Memory allocated will be word aligned in nature.
e.g. for int the address would be allocated as a multiple of
4 .... Next char would start the n+1 where n = multiple of 4.

Similarly next....
when we do sizeof structure we get 60 bytes...
But originally , it should be
4 + 1+ 4+ 8 + 4 *10 = 57 bytes.
The extra three bytes are from char where 3 bytes are wasted
in memory space.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are the variables argc and argv are always local to main?

971


What is a stream in c programming?

1080


What is selection sort in c?

1018


What is wrong with this program statement? void = 10;

1204


what is the function of pragma directive in c?

1061


What is the code for 3 questions and answer check in VisualBasic.Net?

2101


Is it possible to initialize a variable at the time it was declared?

1173


Explain can you assign a different address to an array tag?

1014


How can I do serial ("comm") port I/O?

1131


Explain modulus operator.

999


What is the easiest sorting method to use?

1097


Is fortran faster than c?

983


Write a program to check whether a number is prime or not using c?

1009


What does double pointer mean in c?

1076


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1104