Professional Documents
Culture Documents
Strinq Declaration: of Stvingsthedata 13 Char and The Sizeofthe Array Should Be
Strinq Declaration: of Stvingsthedata 13 Char and The Sizeofthe Array Should Be
Strinq Declaration
data-type aYrayiame Sizel haoa
Im the Case of stvingsthedata type 13
char and the Sizeofthe array should be
total number of charactersto be/stored
plus One One added lb store the
tevmination character (\o) for a str1n, which
suse viternally to identify the end
he Stmng
i vdeclrscrC) o 0
char str Lo
str [ol-'h
Str[11- 'e
str]-T
ande Str 3]'L VATYA
Str 4] = 'otaula
Str [5] '1o
Cout kz/Str od o pisilsidi
getch C) osiloiii a i
1deoibwenit
oiwooablbali
Thivd ay of mitialtzationiunMioy
tinclude < iostream.h7
4+ include Conio. hz
oNotdMain ) lde
Camlinn
sdpvClrscr ()vbi vderornsb OpoY
+include siostream.h
include < conio.hz
Votd MaiC)
drscYc)irte
char str 1o]
coutk Entera string : ai
CinyStr: oino
Tor Ci-o str[il-loitt)V
Cout k4 Str[i] 4k endl;
qetch 0Ne 1tnd NO
lo
To Store MOre than one string IM an
an
array declare two dimens ional chavacter
array Where the Strst dfmen.sion epYesents
theMumberOfStyings and the Second
dimensionrepresenls he length of each
sting
Camlin
tinclude ziostveaM.hy
include k conto.hz
Noid Mai C)
clrscrc)
char st[3][U
int i
tor CiO; is3 it
Cout az " Enter a stng:"
Cin Str [il
getch C)
Output
Enter a strfnq: Houo
mter a strine: a r e
Enter a sirt You
Hoo are you
Camlin