can we define a function in structure?

Answers were Sorted based on User's Feedback



can we define a function in structure?..

Answer / sandeep

We Can't define function inside the structure

Is This Answer Correct ?    4 Yes 3 No

can we define a function in structure?..

Answer / anandhi

structure is nothing but user defined data types...
structure used then more then one datatypes used in single
strud\cture...
syntax:
struct [struct_name]
{
datatype var1;
...
...
};
struct variable creation:
syntax:
struct [name]
{
...
...
}[struct var_name];
[struct var_name].variablename;
.......................................
ex:

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More C Interview Questions

What is array in c with example?

0 Answers  


illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question

0 Answers  


What is the method to save data in stack data structure type?

0 Answers  


How do you use a pointer to a function?

0 Answers  


Explain how can a program be made to print the line number where an error occurs?

0 Answers  


main() { enum _tag{ left=10, right, front=100, back}; printf("%d, %d, %d, %d", left, right, front, back); }

1 Answers   Accenture, Vector,


#include<stdio.h> int fun(); int i; int main() { while(i) { fun(); main(); } printf("hello \n"); return 0; } int fun() { printf("hi"); } answer is hello.how??wat is tat while(i) mean?

7 Answers   Intel,


Differentiate between ordinary variable and pointer in c.

0 Answers  


Find greatest number out of 10 number without using loop.

5 Answers   TCS,


What is true about the following C Functions a.Need not return any value b.Should always return an integer c.Should always return a float d.Should always return more than one value.

11 Answers   TCS,


#define f(x) main() { printf("\n%d",f(2+2)); }

5 Answers  


what is the difference between declaration and definition of a variable or function ?

3 Answers  


Categories