Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int _strlen(char *);
- int _strcpy(char *psz, const char *);
- // int _strcat(char *psz, const char *);
- char sz [100] = "S_ONY",
- sz2[100] = "_Pictures";
- ////////////////////////////////////////////////////////
- int main() //
- {
- _strcpy(sz, "Sobolev Dima");
- printf("sz = %s\n", sz);
- }
- //////////////////////////////////////////////////////// 0 = FALS
- int _strcpy(char *psz, const char *psz2) // 1 = TRUE
- {
- int nLen = 0;
- while(psz2[nLen])
- {
- nLen += 1;
- }
- for(int i = 0; i < nLen; i++)
- {
- psz[i] = psz2[i];
- }
- psz[nLen] = 0;
- }
- //////////////////////////////////////////////////////// 0 = FALS
- int _strlen(char *psz) // 1 = TRUE
- {
- int nLen = 0;
- while(psz[nLen])
- {
- nLen += 1;
- }
- return nLen;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement