Why is struct padding needed?
Answer / Mayank Sharma
Struct padding in C is necessary to ensure alignment of structures during memory allocation. This alignment ensures that data can be accessed quickly and efficiently, as some processors require that certain types of variables start at a specific memory address. For example, some systems might require an integer to start on a 4-byte boundary or a float to start on a 4-byte boundary as well.
| Is This Answer Correct ? | 0 Yes | 0 No |
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
extern static int i func() { i =10; i++; printf("%d \n",i); } main() { i =20; printf("%d \n",i); func(); printf("%d \n",i); }
Where static variables are stored in c?
What is the use of header files?
I heard that you have to include stdio.h before calling printf. Why?
what is a c-language.what is do.
difference between function & structure
hi , please send me NIC written test papers to sbabavalli@gmail.com
What is oops c?
How we can set and clear bit in a byte using macro function?
What is the output from this program? #include <stdio.h> void do_something(int *thisp, int that) { int the_other; the_other = 5; that = 2 + the_other; *thisp = the_other * that; } int main(void) { int first, second; first = 1; second = 2; do_something(&second, first); printf("%4d%4d\n", first, second); return 0; }
why return type of main is not necessary in linux