Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- char sz1[17] = "SONY ",
- sz2[17] = "Pictures";
- ////////////////////////////////////////////////////////
- int main() //
- {
- strcpy(sz1, sz2);
- printf("%s", sz1);
- }
- /*
- #include <stdio.h>
- //#include <string.h>
- char sz[17] = "SONY _ Picterws";
- int _strlen (char *p);
- int _strlen1(char *p);
- int _strlen2(char *p);
- ////////////////////////////////////////////////////////
- int main() //
- {
- int d = _strlen2(sz);
- printf("%d", d);
- }
- ////////////////////////////////////////////////////////
- int _strlen2(char *p)
- {
- int i = 0;
- for(; p[i]; i ++);
- return i;
- }
- ////////////////////////////////////////////////////////
- int _strlen1(char *p)
- {
- int i = 0;
- for(; p[i] != 0; i ++);
- return i;
- }
- ////////////////////////////////////////////////////////
- int _strlen(char *p)
- {
- int i = 0;
- for(; i < 100; i ++)
- {
- if(p[i] == 0) break;
- }
- return i;
- }
- */
- /*
- #include <stdio.h>
- #include <string.h>
- char sz[17] = "SONY Picterws";
- ////////////////////////////////////////////////////////
- int main() //
- {
- int d = strlen(sz);
- printf("%d", d);
- }
- */
- /*
- #include <stdio.h>
- int n = 22;
- char c = 't';
- float f = 3.14;
- double f2 = 3.14;
- char sz[17] = "SONY";
- ////////////////////////////////////////////////////////
- int main() //
- {
- printf("size of int = %2d bytes\n", sizeof(int ) );
- printf("size of char = %2d bytes\n", sizeof(char ) );
- printf("size of float = %2d bytes\n", sizeof(float ) );
- printf("size of double = %2d bytes\n", sizeof(double) );
- printf("size of sz[17] = %2d bytes\n", sizeof(sz ) );
- }
- */
- /*
- #include <stdio.h>
- int n = 22;
- // Ðàçáèòü íà if & goto
- ////////////////////////////////////////////////////////
- int main() //
- {
- if(n == 5) { printf("May \n"); goto L_01; }
- if(n == 7) { printf("July \n"); goto L_01; }
- if(n == 8) { printf("August \n"); goto L_01; }
- printf("Error! \n");
- L_01: return 7;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement