Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- int n = 99;
- /////////////////////////////////////////////////////////////
- struct keyvalue
- {
- char sz[17];
- int n;
- };
- ////////////////////////////////////////////////////////////
- int main()
- {
- keyvalue tt;
- tt.n = 20;
- strcpy(tt.sz, "S O N Y");
- printf("size of tt = %d\n", sizeof(tt));
- printf("&tt = %d\n", &tt);
- printf("&tt.sz = %d\n", tt.sz );
- printf("&tt.sz = %d\n", &tt.sz[0]);
- }
- /*
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- int n = 99;
- /////////////////////////////////////////////////////////////
- struct keyvalue
- {
- char sz[17];
- int n;
- };
- ////////////////////////////////////////////////////////////
- int main()
- {
- keyvalue tt;
- tt.n = 20;
- strcpy(tt.sz, "S O N Y");
- strcat(tt.sz, " Pictures");
- printf("tt.sz = %s\n", tt.sz);
- printf("tt.n = %d\n", tt.n);
- printf("len = %d\n", strlen(tt.sz));
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- int n = 99;
- /////////////////////////////////////////////////////////////
- struct keyvalue
- {
- char sz[17];
- int n;
- };
- ////////////////////////////////////////////////////////////
- int main()
- {
- keyvalue tt;
- tt.n = 20;
- tt.sz[0] = 'S';
- tt.sz[1] = 'O';
- tt.sz[2] = 78;
- tt.sz[3] = 'Y';
- tt.sz[4] = 0 ;
- printf("tt.sz = %s\n", tt.sz);
- printf("tt.n = %d\n", tt.n);
- printf("tt.sz[2] = %d\n", tt.sz[2]);
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- int n = 99;
- struct Ctt
- {
- int n;
- }tt;
- ////////////////////////////////////////////////////////////
- int main()
- {
- tt.n = 20;
- printf("tt.n = %d\n", tt.n);
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- int n = 99;
- ////////////////////////////////////////////////////////////
- int main()
- {
- int *p = (int*)malloc(sizeof(int));
- int &nSONY = *p;
- nSONY = 128;
- printf("nSONY = %d\n", nSONY);
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- int n = 99;
- ////////////////////////////////////////////////////////////
- int main()
- {
- int *p = (int*)malloc(4);
- int &nSONY = *p;
- nSONY = 128;
- printf("nSONY = %d\n", nSONY);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement