Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Реализуйте самостоятельно функции: strcpy и strcat
- #include <stdio.h>
- #include <string.h>
- int _strlen(char *p);
- ////////////////////////////////////////////////
- int main() //
- {
- char sz [77] = "SONY",
- sz2[77] = " Pictures";
- strcpy(sz, sz2);
- printf("%s, strlen = %d \n", sz, _strlen(sz));
- }
- /////////////////////////////////////////////////
- int _strlen(char *p) //
- {
- int i = 0;
- while(p[++i] != 0);
- return i;
- }
- /*
- #include <stdio.h>
- #include <string.h>
- int n;
- ////////////////////////////////////////////////
- int main() //
- {
- char sz [77] = "SONY",
- sz2[77] = " Pictures";
- strcpy(sz, sz2);
- n = strlen(sz);
- printf("%s, strlen = %d \n", sz, n);
- }
- */
- //
- /*
- #include <stdio.h>
- #include <locale.h> // çäåñü "æèâ¸ò" setlocale(LC_ALL, "rus");
- int n;
- float f;
- char c = 'd';
- ///extern char sz[77];
- char sz[77] = "SONY";
- ////////////////////////////////////////////////
- int main() //
- {
- for(int i = 0; i <= 4; i++)
- {
- printf("%c = %2d\n", sz[i], sz[i]);
- }
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement