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?
Answers were Sorted based on User's Feedback
Answer / srinivasroyal
In CPP the above declaration is correct. But in case of C it
is not.
| Is This Answer Correct ? | 7 Yes | 2 No |
no , it is not possible in C.. here structure is not a defined class.. so it is not permitted..
in C++ we can use , that is called class , A derived datatype from a structure :)
class class_name
{
ACCESS SPECIFIER : (private/public/protected)
decleration of data member;
member fucntions definitions
{
......
.........
}
};
thank u
| Is This Answer Correct ? | 4 Yes | 3 No |
how to make program without <> in libray.
What is main return c?
question-how to run a c programme.
Write code for atoi(x) where x is hexadecimal string.
define switch statement?
What are the salient features of c languages?
In CMM or CMMI certified organizations,we assess only the standard software processes of the organization. We do not assess the organizations other functional departments like HR or Admin. Then how can we certify the entire organization as CMM level company?? We have assessed only software related activities. Right. There is no relation with other departments like Accounts, HR or Admin. Then how can we claim that the whole company is a CMM certified company?
int n=1; while(1) { switch(n) { case 1:printf("a"); n++; continue; case 2:printf("b"); n++; continue; default : printf("c"); break; } break; }
What is structure data type in c?
What is c language and why we use it?
what is the function of .h in #include<stdio.h> in c ?
23 Answers HCL, IBM, Wipro,
write a program to find the given number is prime or not
2 Answers Accenture, Vasutech,