Advertisement
dllbridge

Untitled

Feb 21st, 2025
355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include<string.h>
  4.  
  5.  
  6. struct T
  7. {
  8.     char* psz;
  9.     int nlen;
  10. };
  11.  
  12. T t1, t2;
  13.  
  14. void monitor(T *pt);
  15.  
  16. char sz[999] = "SONY_Pictures";
  17.  
  18. //////////////////////////////////////////////////////////////
  19. int main()
  20. {
  21.    
  22.    
  23.     t1.psz  =   sz;
  24.     t1.nlen =    4;
  25.     t2.psz  = sz+5;
  26.     t2.nlen =    8;
  27.  
  28.     monitor(&t1);    
  29.     monitor(&t2);
  30.     //printf("%s \n", t2.psz );
  31.     //printf("%d \n", t2.nlen);
  32. }
  33.  
  34.  
  35.  
  36.  
  37. ///////////////////////////////////////////////////////////////
  38. void monitor(T *pt)    
  39. {
  40.      printf("%.*s \n", pt->nlen, pt->psz );
  41.      printf("%d   \n", pt->nlen);
  42. }
  43.  
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement