g. surgulaZe, g. janeliZe, i. xuciSvili

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

01.03.2013 Views

} return 0; strcmp – ori striqonis Sedareba leqsikografuli mimdevrobiT. gansazRvra: int strcmp(s1,s2) char *s1, *s2; magaliTi 3: #include #include #include int main(void) } { char *buf1 = "aaa", *buf2 = "bbb", *buf3 = "ccc"; int ptr; clrscr(); ptr = strcmp(buf2, buf1); if (ptr > 0) else printf("buffer 2 is greater than buffer 1\n"); printf("buffer 2 is less than buffer 1\n"); ptr = strcmp(buf2, buf3); if (ptr > 0) else printf("buffer 2 is greater than buffer 3\n"); printf("buffer 2 is less than buffer 3\n"); getch(); return 0; strncmp – SevadaroT ori striqonis pirveli n simbolo gansazRvra: int strncmp(s1,s2, n) char *s1, *s2; int n; magaliTi 4: 103

#include #include #include int main(void) { } char *buf1 = "aaabbb", *buf2 = "bbbccc", *buf3 = "ccc"; int ptr; clrscr(); ptr = strncmp(buf2,buf1,3); if (ptr > 0) else printf("buffer 2 is greater than buffer 1\n"); printf("buffer 2 is less than buffer 1\n"); ptr = strncmp(buf2,buf3,3); if (ptr > 0) else printf("buffer 2 is greater than buffer 3\n"); printf("buffer 2 is less than buffer 3\n"); getch(); return(0); strcpy gadavakopiroT s2 striqoni s1 striqonSi. gansazRvra: char *strcpy(s1,s2) char *s1, *s2; magaliTi 5: #include #include #include int main(void) { clrscr(); char string[10]; 104

#include <br />

#include <br />

#include <br />

int main(void)<br />

{<br />

}<br />

char *buf1 = "aaabbb", *buf2 = "bbbccc", *buf3 = "ccc";<br />

int ptr;<br />

clrscr();<br />

ptr = strncmp(buf2,buf1,3);<br />

if (ptr > 0)<br />

else<br />

printf("buffer 2 is greater than buffer 1\n");<br />

printf("buffer 2 is less than buffer 1\n");<br />

ptr = strncmp(buf2,buf3,3);<br />

if (ptr > 0)<br />

else<br />

printf("buffer 2 is greater than buffer 3\n");<br />

printf("buffer 2 is less than buffer 3\n");<br />

getch();<br />

return(0);<br />

strcpy gadavakopiroT s2 striqoni s1 striqonSi.<br />

gansazRvra: char *strcpy(s1,s2)<br />

char *s1, *s2;<br />

magaliTi 5:<br />

#include <br />

#include <br />

#include <br />

int main(void)<br />

{<br />

clrscr();<br />

char string[10];<br />

104

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

Saved successfully!

Ooh no, something went wrong!