Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- ///////////////////////////////////////////////////////
- struct Dima
- {
- // public:
- int nLen;
- char sz[99];
- int nYear;
- float fMath;
- int summ()
- {
- return nLen + nYear;
- }
- };
- int n;
- /////////////////////////////////////////////////////
- int main()
- {
- Dima t1, tArr[40];
- printf("n = %d\n", n);
- strcpy(t1.sz, "SONY Pictures");
- printf("t1.sz = %s\n", t1.sz);
- t1.nLen = strlen(t1.sz);
- printf("t1.nLen = %d\n", t1.nLen);
- t1.nYear = 2015;
- printf("t1.summ = %d\n", t1.summ());
- }
- /*
- #include <stdio.h>
- ///////////////////////////////////////////////////////
- struct Dima
- {
- int nLen;
- char sz[99];
- };
- int n;
- /////////////////////////////////////////////////////
- int main()
- {
- Dima t1;
- printf("n = %d\n", n);
- t1.nLen = 3;
- printf("t1.nLen = %d\n", t1.nLen);
- t1.sz[0] = 'S';
- t1.sz[1] = 'O';
- t1.sz[2] = 'N';
- t1.sz[3] = 'Y';
- t1.sz[4] = 0 ;
- printf("t1.sz = %s\n", t1.sz);
- }
- */
- /*
- #include<stdio.h>
- void foo(char *);
- /////////////////////////////////////////////////////
- int main()
- {
- char sz[] = "SONY";
- foo(&sz[2]);
- }
- /////////////////////////////////////////////////////
- void foo(char *p)
- {
- p -= 2;
- printf("%s\n", p);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement