Y/gce stringi.c -o stringi •UaLL
iinclude <stdio.h>
Imcludc <strzng.h>
•define TAB_MAX 28
int main(void){
char str [ TAB__MAX] = " " ;
printf( "36s = *d\n", "TAB_MAXM , TAB_MAX) ;
printf( "str=:%s\nstrl«n(str )r581u\r " ,str,strl«n(str) ) ;
printf ( Mstr=$SsV sizeof (str )rfclii\n\r<", str, sizeof ( str ) ) ;
strcpy (str,"1234567890");
printf("str=%s\rstrlen(str)=ftlu\r M,str,strlcn(str)); printf(“str=%s isizaof(str)r%lu ,n\r■,str,sizeof(str));
strcat (str,"asdfghjkl");
printf("strrfcs rstrlen(str)=fclu ",str,strlen(str)); printf ( "itrr^i .sizeof (str )=9flu\n \nm , str,sizeof (str ) ) ;
strcat (str,"1234567890"); size_t roz;
printf ( "str=3K*\r strlen(str )s%lu\n" , str,roz=strlen(str)) ; printf("strrti r sizeof(str)=3Slu\r\r",str,sizeof(str));
str[5]='\0*;
printf ( "str=:fcs rstrlen(str )s*lu\n*, str,strlen(str)) ; printf("itr=Xs\»siztof(str)s%lu\n\n",str,sizeof(str));
28
21
22
23
24
25
26
27
28 29 38
31
32
33
34
35
36
37
C ® 1 ? _*« NF* :to*
F-djr*)* Widok Piu«i|«a< Zakisdki U statuom
sizeof(str)=20 str=1234567890 strlen(str)=10 str=1234567890
tr=l234567890asdfghjkl
str=1234567890asdfghjkl sizeof(str)=20
str=1234567890asdfghjkll234S
strlen(str)=29
str=1234567890asdfghjkll2345 cizeof(str)=20
str=12345 strlen(str)=5 str=1234S sizeof(str)=20
12345 znak_konca_lancucha 7890asdfgh ancucha znak_konca_lancucha py710k;ToyTown :wyklad_04_HEW$
r -■ vyłd.d 04 HEW buh
o O V ttrbąiJ KWri*
Phk Fdytuj Widok Ntn^±a« Urt«-rmu« Pomoc
1 2
3
4
5
6
7
8 9
ii
13
14
15 J6
17
18 char *pc=str; int i=0; for(|i<roz;i+f) tf(♦(pc+i))
printf ("3Sc" ,*(pc+i));
printf(" znak końca łańcucha
71X — — t •