0% found this document useful (0 votes)
5 views

T9U5 Miscellaneous Functions

The document describes two miscellaneous functions in C++: 'assign()' for assigning parts of a string to another string, and 'beign()' for obtaining a reference to the first character of a string. An example code snippet demonstrates the usage of these functions, showing how to assign a substring and access the first character. The output of the code is 'C plus' and 'C'.

Uploaded by

joyalprincess
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

T9U5 Miscellaneous Functions

The document describes two miscellaneous functions in C++: 'assign()' for assigning parts of a string to another string, and 'beign()' for obtaining a reference to the first character of a string. An example code snippet demonstrates the usage of these functions, showing how to assign a substring and access the first character. The output of the code is 'C plus' and 'C'.

Uploaded by

joyalprincess
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Miscellaneous Functions

· assign() -- This function is used to assign a string wholly / partly to another string object .

· beign() -- This member function returns the references of the first character of the string

#include<iostream.h>

#include<conio.h>

void main()

clrscr();

string s1(" C plus plus ");

string s2;

char *x;

x=s1.beign();

int x=0;

s2.assign(s1,0,6);

cout<<s2;

cout<<*x;

getch();

OUTPUT

C plus

You might also like