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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

637


If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402

3245


Dont ansi function prototypes render lint obsolete?

601


What is the use of a conditional inclusion statement in C?

596


What are two dimensional arrays alternatively called as?

653






Why malloc is faster than calloc?

586


How can I swap two values without using a temporary?

610


How can I prevent another program from modifying part of a file that I am modifying?

606


how to find binary of number?

3421


Can you define which header file to include at compile time?

584


What is the use of parallelize in spark?

570


Do you know pointer in c?

584


What is structure packing in c?

602


Which driver is a pure java driver

987


What is sizeof in c?

569