g. surgulaZe, g. janeliZe, i. xuciSvili

g. surgulaZe, g. janeliZe, i. xuciSvili g. surgulaZe, g. janeliZe, i. xuciSvili

01.03.2013 Views

} strrchr – vipovoT striqonSi C simbolos bolo CarTva. gansazRvra: char *strrchr(s,c) char *s; int c; magaliTi 9: #include #include #include int main(void) { clrscr(); char string[20]; char *ptr, c = 'r'; strcpy(string, "This is a string"); ptr = strrchr(string, c); if (ptr) string); } else printf("The character %c is at position: %d\n", c, ptr- printf("The character was not found\n"); getch(); return 0; strpbrk – vipovoT s1 striqonSi nebismieri simboloebis simravle, dawyebuli im simbolodan, romelic Sedis s2 striqonSi. gansazRvra: char *strpbrk(s1,s2) char *s1, *s2; magaliTi 10: 107

#include #include #include int main(void) { clrscr(); char *string1 = "abcdefghijklmnopqrstuvwxyz"; char *string2 = "onm"; char *ptr; ptr = strpbrk(string1, string2); if (ptr) else printf("strpbrk found first character: %c\n", *ptr); printf("strpbrk didn't find character in set\n"); getch(); return 0; } strspn - ganvsazRvroT s1 striqonis monakveTis sigrZe, romelic Seicavs s2 striqonSi Semavali simboloebis simravles. Zebna Sewydeba, roca s1 striqonis mimdevrobiT wakiTvisas, gansaxilveli simbolo, ar aRmoCndeba s2 striqonSi. gansazRvra: int strspn(s1,s2) char *s1, *s2; magaliTi 11: #include #include #include #include { int main(void) clrscr(); 108

}<br />

strrchr – vipovoT striqonSi C simbolos bolo CarTva.<br />

gansazRvra:<br />

char *strrchr(s,c)<br />

char *s;<br />

int c;<br />

magaliTi 9:<br />

#include <br />

#include <br />

#include <br />

int main(void)<br />

{<br />

clrscr();<br />

char string[20];<br />

char *ptr, c = 'r';<br />

strcpy(string, "This is a string");<br />

ptr = strrchr(string, c);<br />

if (ptr)<br />

string);<br />

}<br />

else<br />

printf("The character %c is at position: %d\n", c, ptr-<br />

printf("The character was not found\n");<br />

getch();<br />

return 0;<br />

strpbrk – vipovoT s1 striqonSi nebismieri simboloebis simravle,<br />

dawyebuli im simbolodan, romelic Sedis s2 striqonSi.<br />

gansazRvra:<br />

char *strpbrk(s1,s2)<br />

char *s1, *s2;<br />

magaliTi 10:<br />

107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!