L
Lalatendu Das
hi let's say i have a structure
struct test {
int A;
char B[5];
int C;
};
this above structure defination always going to take 16 byte in
memeory in whatever manner we align the member variables while
declaring a variable to it .
because variable 'A' going to take 4 byte then four charachter of
array gonna take another 4 bytes but the remaining will take also 4
bytes due to four byte alignment nature of compiler .
and last four byte by integer C .
what i want is there any way i can start storing integer C just after
the storing completion of array B's last element i.e. B[4] , so that i
can suppress padding . Any program which make memory manager store in
the above manner is most welcome.
thanks priorly because i am sure i am gonna get innumerable answer to
it .
struct test {
int A;
char B[5];
int C;
};
this above structure defination always going to take 16 byte in
memeory in whatever manner we align the member variables while
declaring a variable to it .
because variable 'A' going to take 4 byte then four charachter of
array gonna take another 4 bytes but the remaining will take also 4
bytes due to four byte alignment nature of compiler .
and last four byte by integer C .
what i want is there any way i can start storing integer C just after
the storing completion of array B's last element i.e. B[4] , so that i
can suppress padding . Any program which make memory manager store in
the above manner is most welcome.
thanks priorly because i am sure i am gonna get innumerable answer to
it .