Differences between Structures in C and C ++
Differences between Structures in C and C ++ Let's understand this through an example:-- Structure in C language structure in C Here in above example ,we saw that how Structure define and call in C Language. Structure in C++ language structure in C++ Here , we seen that differences in structure define and calling C++ i.e 1- we can not only initialize or call as member variable in structure body( int bookid,char title,float price)but function are also initialize or call as member function in structure body(void input(),void display()). 2- In above example ,we can seen that input() function access directly bookid,title and price without any b1.bookid,b1.title,b1.price written as we seen in C language Structure and at the time of input() function calling by main () function it's directly call as b1.input() and we can say that input function belong to b1 object.i...
Comments
Post a Comment