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 can I write functions that take a variable number of arguments?

1133


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1288


write a program for the normal snake games find in most of the mobiles.

2265


What is the 'named constructor idiom'?

1099


What is c programing language?

1094


What language is lisp written in?

1272


What is difference between union and structure in c?

1173


Why is C language being considered a middle level language?

1134


Explain why C language is procedural?

1230


List some applications of c programming language?

959


Why doesnt the call scanf work?

1202


What is c preprocessor mean?

1322


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

1055


struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

1300


What is I ++ in c programming?

1125