What is the purpose of #pragma directives in C?
Answers were Sorted based on User's Feedback
Answer / nashiinformaticssolutions
#pragma provides compiler-specific instructions.
Example:
#pragma pack(1) // Forces 1-byte alignment for structures
struct Example {
char a;
int b;
};
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / glibwaresoftsolutions
#pragma provides compiler-specific instructions.
Example:
#pragma pack(1) // Forces 1-byte alignment for structures
struct Example {
char a;
int b;
};
| Is This Answer Correct ? | 0 Yes | 0 No |
When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?
what is difference between userlevel threads and kernel level threads ?what are the trades offs between these two approaches ? what approach is most frequently used and why ?
What is Memory leakage ?
If I want to initialize the array like. int a[5] = {0}; then it gives me all element 0. but if i give int a[5] = {5}; then 5 0 0 0 0 is ans. what will I do for all element 5 5 5 5 5 in a single statement???
What is non linear data structure in c?
Write a program to reverse a given number in c?
What are the advantages and disadvantages of a heap?
What is the output for the following program #include<stdio.h> main() { char a[5][5],flag; a[0][0]='A'; flag=((a==*a)&&(*a==a[0])); printf("%d\n",flag); }
how to print a statement in c without use of console statement ,with the help of if statement it should print
what is the output of following question? void main() { int i=0,a[3]; a[i]=i++; printf("%d",a[i] }
main() { printf("hello"); fork(); }
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
2 Answers HCL, IBM, Satyam, Vimal, Vimukti Technologies,