Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include<string.h>
- struct T
- {
- char* psz;
- int nlen;
- };
- T t1, t2;
- void monitor(T *pt);
- char sz[999] = "SONY_Pictures";
- //////////////////////////////////////////////////////////////
- int main()
- {
- t1.psz = sz;
- t1.nlen = 4;
- t2.psz = sz+5;
- t2.nlen = 8;
- monitor(&t1);
- monitor(&t2);
- //printf("%s \n", t2.psz );
- //printf("%d \n", t2.nlen);
- }
- ///////////////////////////////////////////////////////////////
- void monitor(T *pt)
- {
- printf("%.*s \n", pt->nlen, pt->psz );
- printf("%d \n", pt->nlen);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement