STRINNGS A
Each
pi0gramming languagk contains a
Charactet Set Sused to comumicate clth
à ComputeT 1his, Set tncludes the ollotltng
Alphabe t Ca to a) digits(o-9),Special chátac
ns Ct,-,X, / , )etc. Strng is a
Stquence o3ero o [Link]
.05tTmg l t h äero character tS callecd empty
String 0Mull striMg Speci4c 6trimgs
CAlRI 6e dnoted 6enclo6ng their chard-
cter clou6le ouotdtro Mark S. The quo tål-
r ionmàrks l t be called stting teugth.
delimiteTs
fre
Data TepTesentatton jor otrimg s
SArinas can be stored ustnq three types st.
cAural techmiques,
.Fined le-natn átring methocd 0- Record OT
tented
2arable length 6toragt iih ed mantt..
Um
3 linkad tist method.
)Fned length Strinq Method:
method ts that
he general
1he iden behénd his
handle the
StYMg varjables dr allocated to
maimum possible string le-ngth As stTings
Cmtened into Such locattoms those &ttinms
that do mot attain thiS matimum aTe leat
Justrzred ancl padded lth lamks on the Tig
ht.A Spåce occupitd by the stting padde
CAith the blanks on
the Ttghtcamnot be
ccttvelu callecd tin ecength itotage
àt pTint 1S vietlecl às a eco1d,
Each line
a11 TecoTdS have Some lemgth e ,
Clhere
accOmadate the Same mo.
CAhere each mecoTd
characters
As n eLample to MaMipu lating a piece
t e n t conststng dINe "lme s WheTE
6
s0 cha1acter s
as ma
Cach the CoMSiSt o
the tert
tmum length The tenath lnes o
aTe PTOqTammMe r
Crote Pgms he a
bulders butlt [Link] alerd
that
that
Càme alomq alould desttos
that
civiltzation.
ën memoTY
This
1his loud be StoTed
progTdmmeT
Note pms
sas 4otlo tls , la he butdeTS built 53
6lamks,the Nay that
SI
blamks 44 blamk S
built
HhatcaMe
sqblanks
$ 6lanks
destro
Aduantages
1.
1hehe east oh äcce ssl19 data Tom ny qtvem
TecOTd dR
1h8
1he ase
o updattng data tn any given TecOTd
AS loma as cEngth o data does not eiceec
he maLMUM.
Disadvântàges:
hra
(lastage 0 timem MeadiMg 6ttng is most ot
StoTage consists n essential 6lank S pacesS,
Some TecoTclsmay TequtTe moTe spåce than
auarlable
Re stricting the length o the &tring
3. t h e coTTecAtonS to be done, includtj entTa
chatacters i more cháacters are to be inse
,then the enttre
Tted im the oTgmal stTmg
TecTd has to be chamgecd.
third disadudn tage can be Meme
hoin he is usec
A pointe aTray
died usimg potntens Success ive Te-
address oh each
hrch awes the
be stored in con.
not
SOTd S0 Ahat secOTds Meed iMse7-
locattonS MmemoTy TherefoTe,
&uttNe oly dn upcla-
gecoTdCil Tegure
ttng a mel to
aTray ponter Preod
4nq oh the
23Variable leng th Stotage CNith jintd Ma-
The Storage ot VaTiable lenqth Strmgs m mem
6Ty cells CAith ed marxinmum Aemgths ay
be done t o gemeTal WauS,
)A marker Such o ts used td Slqnal
the end o string
i)The ength o StTing is ncludtd tm poin
ter atauin addittbm to addneSs o 1he
StTimg
CAT
DISTU BLS\
LA \o
RAT
ReLve uting log teld
tach laus o stoTing siTiMa Save spåce
When te
and are usec in Secondaru memorY
oTds aTC permenant
ancd nequited üttle chanqe.
T h e s e m e t h o d s are meHicint cNhen strmas
and onaths ate \tequently echange
3-Lnked list Methods
prOceSS-
ComputtS Arc betng used tor Ner
The Comput muct be able to modibl
ing
the PTinte c MaltedeletimgMserting,updAtiv
changing,tlords,Sentencec or pataaraphs toTtoT
tloTd prKOCe ss mg applicatio n. strings are storel
by meaM ot tinked list A linkel i st is 4
lincaT Ooderecl Sequnt o1 mem0y Cole
alled nodes.A node Conssts oh mhOTmaio
hoTmati
aned tht addreSS o the mert noc m the
doa ptr
wratim n a mmavy ce0l tan be
inak tharatkr ov
ixed Vuhu
tharatkrs.
GUOD DAH
* NTite
X
LABX
Tite aà pgm
pgm hoT patteTn Matchimg
t inclucdle <stdio-h
t include <conio-h>
tinclude <string:h>
Notd matmc)
nt K, S, inden ,1,ma1
char s501 , Pat L50
PTint ("Enter 4he StTing")
gets (s)
patterm:),
Pnth Enter 4he
gets (pat)%
S= Strlen (Si)
Strlen (pat);
inden 0
Mar S -
T+\,
k-
CAhile (k<=max)
,++i)
0T i-0,ikT
CiJl = SiLi{K-
4Pat
C n
qoto
nder - k
break
Print Ci he Substring is present at pcátio
inder) ,
Aaltcl4
Anite à
pgm to eueseà atximg
mclude <sidip h>
tinclude<string-h>
+include <conto h>
Main
cha [Link]);
int i, j=0, "),
the Strmg
Prnth ("Enter
gcts CS)
- Strlen (S1),
(--)
4oT (--1;i>z0 r
PMint1he OTiginal
sning \m
PutS(S),
Strg m")
ptnthCReuerse o {he
puts (Sa ,
A ite à pqm to reuerse a String using poi
mters
Mdinc
char s * S
int i, js
Printy("Enter à SATing ." )
getsCs)
Strlen (St)
or (i--1, ioi- - )
* (S+j) -*(S1+i)%
Sat)' \o'
PrinthReuerse o Strmg - °loSS);