Start Discovering Solved Questions and Your Course Assignments
TextBooks Included
Active Tutors
Asked Questions
Answered Questions
aim to implement program to calculate area of cube using inline functioncodeinline void areacubefloat
aim to implement a program to swap two numbers using reference argumentscodevoid swapint a int b int
temperature conversions problems 28 through30generate temperature-conversion tables use the following equations that give relationships between
basic salary of an employethe allowence are house rent 20 of basic salary medical allowence is 10 of basic salary conveyence
i am working on a program that allows a player to play a game against the computer in this game the player can only chose to draw 1 2 or 3 toothpicks
rules of inheritance private members are not inherited the members can be accessed only within its class it cannot be used through the object
converting base type to class type char to string class string char nameint lengthpublicstringvoidlength 0name new charlength1stringchar slength
overloading binary operators using friend functionclass sifloat ipnrapublicsisiint gpint gn int grvoid putdatavoidfriend si operatorsisisi operatorsi
overloading unary operators using friend functionclass signint abcpublicsign signintintint void putdatavoidfriend void operator-sign ampvoid
overloading binary operatorsclass sifloat ipnrapublicsisiint gpint gn int grvoid putdatavoidsi operatorsisi sioperatorsi i1si i2 i2ppi1p i2iii1i
overloading unary operatorsclass signint abcpublicsign signintintint void putdatavoidvoid operator-void signoperator-a-ab-bc-c
rules of operator overloading it is a function defined to an operator with new term or meaning it cannot produce new operator it cannot modified the
destructorthe purpose of destructor is to free the memory when the compiler memory is reduced or not enough to execute certain program sometimes
dynamic initialization of objectsit is initializing the objects by passing the valued to the constructor from the user input orother means
constructors and destructorsa class is defined as constructor by declaring a constructor in the form of function insidethe class in other word a
a class can be defined inside a block or function this type class is known local class there are few points to be observed when producing class
pointer declaration for member functionmethod 1 when class is not declared as pointerm nvoidmpfintintampmsetxy npf1020nsetxy1020 is same as prior
pointer declaration for data member method 1int m px this is known as pointer-to-member declared for class member of apx ampmxthe pointer px is
pointer declaration for classm mm pm class m is declared as pointer pmampmpointer class is assigned to a
pointers to membersin c a pointer is created to locate the address of another variable for faster accessconsider the following example
friendly functiona class can have public members and private members the public member can beused through the class using dot
function returning objectthis program is like to the previous program except the function returns object themain rule to be remembered is the
objects as function argumentsin c program there are several methods to define arguments and in some case even astructure can be approved as an
array of objectsthe objects can be declared just like a structure or even a primary data type array of objects may be required to work with large
static data membersa data member inside the class can construct as static data member there are fewguidelines to be followed when declaring