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

How arrays can be passed to a user defined function

1006


Using which language Test cases are added in .ptu file of RTRT unit testing???

4262


What is local and global variable in c?

1177


I need a sort of an approximate strcmp routine?

1013


What are the functions to open and close file in c language?

1187


What's the right way to use errno?

1125


State the difference between x3 and x[3].

1102


What is linear search?

1121


How do you determine whether to use a stream function or a low-level function?

1110


Write a program which returns the first non repetitive character in the string?

1103


What are dangling pointers? How are dangling pointers different from memory leaks?

1289


int far *near * p; means

3538


What is array within structure?

1098


Explain function?

1074


What are the types of type specifiers?

1015