0% found this document useful (0 votes)
7 views6 pages

String Beans

String code c lang

Uploaded by

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

String Beans

String code c lang

Uploaded by

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

classmate

Data

Page

ste sfing is Sequln ce cf cavacky


femnated

-sfrg is stored as arng of choracter


chaváctfe,
sting is temintre with kique rhavactev ('\o
teclatin of Sfin
st
Syntax chay stin hame si2e7
Tntdi sah of stiny
O4s515nin stius withot Sire

st[7 =RscCF
char str C]= {"Rs (of
predefioefd Size
char str [soI:

3ssishins chaacfer by davacter wt siSi a22


char st r o J ¿R

Asiaing characey b dasactey withet sre


char str l] = t e S C 0 E
Date
Page

jut mainc)

char st [so7
SCant ("2. s , str )

Can be decarcd in 2ways in clag


O ha aay
Literat
stig
chor dh Co]= RS, CoE
char ch [1-
RSCOE".
tyutwsS aseo witt be apendd a
stig Compi ler
in char aray Ne neeo ti add o at en
by campleY.
sting iterd canat bc as St Gnrd tu auot
characteY S uhereas Carn
(haracfen of Hassig
classmate
Date
Page

#include cstdiohy
jt main ( O

Char S

Char RSCo
.5ch)
priutf(" sfing

Pting stig tyrfhey


we
we
can net
ca wt
assisn One
stiny h othor direety
joi foo stis tgethes
antsmetic additten

These at nt
ej sbi
Valid.
stg
The characers m
stig laud stiy 2 shauld
be cepied int strins 3 ne affe anahey aud
The size of aray/sbiy s shadh be
hold to tal charatfers.
canbinig sbing hgethey (s

Called Con catenaten.


Date
Poge

3
I han()

Jn] "Pune"
Chaw stihy z
1[J \0 ,t tt)

3j+t)
stig?LjI
0
pitf(aftev con cat nafen o<p wiIN be. s

retn o)

Conpari Son of tuo strinys


compane two stinys it is eg ed to test
Char by chay Com pani son
Compan su1 s dene util ther
One of the
nll s tiny ls term
(ha wli dheyev Cats fst

char st 01:
cdassmate
Date
Page

while (s i Ci1: st 2 (i3 fs

pritf(" Cqual
else pxitf Not
turn o'

stinq Houdlug runctns


libray Suppot large no
ot sting handling
tht can be used to Cary ot many ef
manipetians.
strlen 0:
Thi s funh (owuk aud eturn tha
ho of chaacters in a stius
S}ntax!
h strlen(striy name
strcat C)
two
Sbings tog<fhe
Syntax:
strt(sti 1 striag 2);
sti two ade
of vCI1 As paot (om cng str
striy stig
2, es( st
aSsjo
i strig
String ike wok fun Tas Cpy) st

You might also like