How to avoid structure padding in C?

Answer Posted / ravi

by using #pragma you can avoid structure padding. and that
to u can use it in linux or unix if i m not wrong.

Is This Answer Correct ?    55 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include #include #include #include int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

1842


Without Computer networks, Computers will be half the use. Comment.

2046


a c code by using memory allocation for add ,multiply of sprase matrixes

2516


What are the restrictions of a modulus operator?

835


What is the use of typedef in structure in c?

706


Why c is called free form language?

750


What is structure in c explain with example?

849


What are the different properties of variable number of arguments?

884


What is c language and why we use it?

799


What is printf () in c?

773


can any one provide me the notes of data structure for ignou cs-62 paper

1897


Is it valid to address one element beyond the end of an array?

903


Why is extern used in c?

825


What is the difference between declaring a variable by constant keyword and #define ing that variable?

2995


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

825