difference between function & structure

Answer Posted / vignesh1988i

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 ?    78 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

2847


Explain how do I determine whether a character is numeric, alphabetic, and so on?

754


I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.

1588


What is spaghetti programming?

767


What is the difference between text and binary i/o?

665






What are external variables in c?

652


What is getch () for?

786


What is array in C

807


What is typedef?

809


Why isn't any of this standardized in c? Any real program has to do some of these things.

756


What is a ternary operator in c?

756


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

735


What is %s and %d in c?

672


Disadvantages of C language.

740


write a c program in such a way that if we enter the today date the output should be next day's date.

1796