Professional Documents
Culture Documents
Array (Int Cap: Private Members: Int Data Pointer To An Array of Integers
Array (Int Cap: Private Members: Int Data Pointer To An Array of Integers
• Usage of constructor/destructor.
• Targets the object transition by reference.
• Character array manipulation.
If user sends any invalid value ( —ve valUe) then sets the cap to zero.
'VA r ray ( )
Free the dynamically al located memory.
int & get Set (int index) ; insert value at
given index of array.
class String
char * data; //points to char array int size; // represents the size of
array pointed by data. public:
String ( ) ; Initializes data to nullptr and size
to 0.
Strin (char c); Initializes data with char c
String(const char Initializes the data with received strin b
allocatin memor on hea
A- You know what to do.
Strin
void input(); Takes Input from console in calling
0b ect.
Index: Receives the Index for
string.
char & at(int index) ; Return Value: reference of array
location re resented b index
Tells whether string is empty or
not? An empty string is one which
boot isEmpty( has data==nullptr or