<\/a><\/p>\n <\/p>\n
Syntax for friend function is as follows:<\/p>\n
Class Student<\/i><\/p>\n
{<\/i><\/p>\n
Private:<\/i><\/p>\n
int mark1,mark2<\/i><\/p>\n
Public:<\/i><\/p>\n
int roll<\/i><\/p>\n
void getdata()<\/i><\/p>\n
{<\/i><\/p>\n
Mark1=50;<\/i><\/p>\n
Mark2=60;<\/i><\/p>\n
}<\/i><\/p>\n
Friend void myfriend(void)<\/i><\/p>\n
};<\/i><\/p>\n
Constructor<\/b><\/p>\n
Constructor is a function it job is to do automatic initialization of data upon creation of object. Constructor neither takes any argument nor returns any value. Class name and constructor name is always same.<\/p>\n","protected":false},"excerpt":{"rendered":"
Class Class is the collection of data and functions means class encapsulates the data and function this is feature of object oriented programming. Objects are the variable of class one can imagine class as structure in C. You can created any number of object of class ( using the concept of array of objects it […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[55],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/posts\/554"}],"collection":[{"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/comments?post=554"}],"version-history":[{"count":1,"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/posts\/554\/revisions"}],"predecessor-version":[{"id":557,"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/posts\/554\/revisions\/557"}],"wp:attachment":[{"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/media?parent=554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/categories?post=554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techliebe.com\/wp-json\/wp\/v2\/tags?post=554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}