How to avoid structure padding in C?

Answer Posted / t swain

by using #pragma you can avoid structure padding.

Is This Answer Correct ?    18 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

878


How does pointer work in c?

723


#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??

1637


What is the difference between if else and switchstatement

1406


Is it better to bitshift a value than to multiply by 2?

738






I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

9766


how is the examination pattern?

1693


main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }

1005


How can you check to see whether a symbol is defined?

693


Can you add pointers together? Why would you?

748


Difference between malloc() and calloc() function?

753


What are the valid places to have keyword “break”?

734


When can a far pointer be used?

674


Can you please explain the difference between strcpy() and memcpy() function?

704


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

745