ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
what is the use of #pragma pack, wer it is used?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is the use of #pragma pack, wer it is used?
Answer
# 1
actually pragma pack is used for structure padding 
we are having #pragma pack 0,#pragma pack 1,#pragma pack
2,#pragma pack 3,#pragma pack 4
in this first one will allocate memory 4 bytes for every
data type
in second one i.e in pack 1 it allocates 1 byte for every
data type
in third one i.e in pack 2 it allocates 2 bytes for every
data type
in fourth one i.e pack 3 it allocates 3 bytes for every data
type 
in fifth one i.e pack 4 it allocates 4 bytes for every data type

Actually pragma will be used in powers of 2 only
 
Is This Answer Correct ?    0 Yes 3 No
Ram
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
How to implement variable argument functions ? HP1
who did come first hen or agg Infosys12
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.  3
what are brk, sbrk? Oracle1
How can I read a directory in a C program? Wipro1
Hai why 'c' is the middle language  2
why should i select you? Wipro18
Given a single Linked list with lakhs of nodes and length unknown how do you optimally delete the nth element from the list? Oracle1
How can I invoke another program from within a C program?  6
what is the associativity of bitwise OR operator?  1
what is the output? #define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t) float gfloat; main() { float a=1.12,b=3.14; fun (a,b,float); printf("na=%4.2f,b=%4.2f",a,b); } A)Error in Defining Macro B)a=1.12,b=3.14 C)a=3.14,b=1.12 D)None of the Above Accenture2
What is meant by int fun const(int a, int b) { .... ... }  1
18)struct base {int a,b; base(); int virtual function1(); } struct derv1:base{ int b,c,d; derv1() int virtual function1(); } struct derv2 : base {int a,e; } base::base() { a=2;b=3; } derv1::derv1(){ b=5; c=10;d=11;} base::function1() {return(100); } derv1::function1() { return(200); } main() base ba; derv1 d1,d2; printf("%d %d",d1.a,d1.b) o/p is a)a=2;b=3; b)a=3; b=2; c)a=5; b=10; d)none 19) for the above program answer the following q's main() base da; derv1 d1; derv2 d2; printf("%d %d %d",da.function1(),d1.function1(),d2.function1 ()); o/p is a)100,200,200; b)200,100,200; c)200,200,100; d)none 20)struct { int x; int y; }abc; you can not access x by the following 1)abc-->x; 2)abc[0]-->x; abc.x; (abc)-->x; a)1,2,3 b)2&3 c)1&2 d)1,3,4  1
1,4,8,13,21,30,36,45,54,63,73,?,?. Franklin-Templeton5
What is volatile in c language? HCL1
n=7623 { temp=n/10; result=temp*10+ result; n=n/10 } Wipro4
plz answer.... write a program that reads line (using getline) e.g."345", converts each line to an integer using "atoi" and computes the average of all the numbers read. also compute the standard deviation.  1
how to connect oracle in C/C++.  2
What is C language Terminator? TCS12
What is the most efficient way to count the number of bits which are set in a value?  3
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com