can we declare a function inside the structure?
ex: struct book
{
int pages;
float price;
int library(int,float);
}b;
is the above declaration correct? as it has function
declaration?

Answer Posted / srinivasroyal

In CPP the above declaration is correct. But in case of C it
is not.

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are directives in c?

729


What are the advantages of c preprocessor?

959


Find MAXIMUM of three distinct integers using a single C statement

809


Is c language still used?

716


What is the difference between fread and fwrite function?

817


What does c value mean?

846


What is main () in c?

775


Explain the properties of union. What is the size of a union variable

914


Write a program to find the biggest number of three numbers in c?

795


Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

1961


Explain how do you override a defined macro?

791


What is use of integral promotions in c?

863


How can I recover the file name given an open stream or file descriptor?

812


What is a example of a variable?

747


why we wont use '&' sing in aceesing the string using scanf

2051