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   SiteMap shows list of All Categories in this site.
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
difference between  function & structure
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: difference between function & structure
Answer
# 1
I) Inside the Structure we can use Property,Indexes,etc..
II) Both constants and enumerations may be defined within a 
structure,
III) Multiple constructors can be created within a 
structure.
IV) EVENTS is possible in structures
v) Memory wise differ
 
Is This Answer Correct ?    0 Yes 0 No
Samarasam
 
  Re: difference between function & structure
Answer
# 2
functions can return values.
structures cannot return values.

we can pass arguments to the function
we cannot pass any argument to the structure.
 
Is This Answer Correct ?    0 Yes 0 No
Shruti
 
 
 
  Re: difference between function & structure
Answer
# 3
Functions:
a)used to separate the task which would run frequently 
b)run seperately the frequent task whenever calling that 
frequent task and then returned its value to the fucntion 
who called this.
c)would decrease the complexity of code and helps to debug 
easier.
d)also it can be used as a library fucntion.

Structure:
declaring different types of variables and functions under 
single name.
 
Is This Answer Correct ?    0 Yes 0 No
Babitha_b
[HCL Technologies]
 
  Re: difference between function & structure
Answer
# 4
1st :
FUNCTIONS :
these are derived data types 
STRUCTURES :
these are user defined datatypes

2nd :
FUNCTIONS :
function returns a value 
STRUCTURES :
structures is not a function but only a datatype which returns no value.

3rd :
FUNCTIONS :
function does not have a provision of self referencial pointers. 
STRUCTURES :
in this we can make one data member as a pointer to the same structure. that is self referencial structures.

4th :
FUNCTIONS :
function s consists of formal as well as actual arguments.
STRUCTURES :
here structures is a special datatype which holds all the possible form of data (i.e) int, char,float,double ,in combination s.

5th :
FUNCTIONS :
functions are reusable anytime and anywhere in the program, whenever we wann to re-use the code again we can simply call the function.
STRUCTURES :
but in structures we can do as above,we must access the data using '.' or when comes to pointers we must access through '->' operator



this are the statements that to my knowledge can said as difference... BUT STRUCTURES CANNOT BE COMPARED WITH FUNCTION SINCE, TWO ARE INDEPENDENT TO EACH OTHER.

THANK U
 
Is This Answer Correct ?    1 Yes 0 No
Vignesh1988i
 
  Re: difference between function & structure
Answer
# 5
structure:it holds dissimiliar datatypes when compared to  
   array.
          
function:it is used when an operation has to be done by
skipping some of the stepsi.e., function call
 
Is This Answer Correct ?    0 Yes 0 No
Lakkup
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
what is the stackpointer  2
identify the in correct expression a.a=b=3=4; b.a=b=c=d=0; float a=int b=3.5; d.int a; float b; a=b=3.5; TCS5
12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV Accenture4
plz answer.. a program that takes a string e.g. "345" and returns integer 345  3
write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]  2
What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?  1
what is memory leak?  3
what is the differnce between AF_INET and PF_INET? Wipro2
what is use#in c  3
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } CitiGroup7
why java is called as a purely oops language.  2
What are the preprocessors? HP6
How would you print out the data in a binary tree, level by level, starting at the top? Microsoft4
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } CitiGroup17
write a programe returns the number of times the character appears in the string  1
Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning Accenture4
Reverse the part of the number which is present from position i to j. Print the new number. eg: num=789876 i=2 j=5 778986  1
whether itis a structured language? Microsoft1
#include<stdio.h> main() { char s1[]="Ramco"; char s2[]="Systems"; s1=s2; printf("%s",s1); } Find the output CitiGroup4
15.what is the disadvantage of using macros? 16.what is the self-referential structure? 17.can a union be self-referenced? 18.What is a pointer? 19.What is the Lvalue and Rvalue? 20.what is the difference between these initializations? 21.Char a[]=”string”; 22.Char *p=”literal”; 23.Does *p++ increment p, or what it points to?  1
 
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