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
How can I write functions that take a variable number of arguments?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
write a program for the normal snake games find in most of the mobiles.
What is the 'named constructor idiom'?
What is c programing language?
What language is lisp written in?
What is difference between union and structure in c?
Why is C language being considered a middle level language?
Explain why C language is procedural?
List some applications of c programming language?
Why doesnt the call scanf work?
What is c preprocessor mean?
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
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
What is I ++ in c programming?