Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / vignesh1988i

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can the sizeof operator be used to tell the size of an array passed to a function?

1054


What are header files? What are their uses?

1120


What is extern storage class in c?

939


What is scope and lifetime of a variable in c?

988


define string ?

1054


What is adt in c programming?

1095


What is unary operator?

1047


hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm

1965


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1846


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

15924


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

1412


What is uint8 in c?

1052


write a program fibonacci series and palindrome program in c

975


how should functions be apportioned among source files?

1054


Why do some versions of toupper act strangely if given an upper-case letter?

1033