Advertisement
dllbridge

Untitled

Mar 12th, 2023
784
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.64 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. #include   <stdio.h>
  6.  
  7.  
  8.  
  9.  
  10. char sz[123] = "TDK";
  11.  
  12. char *psz    =  sz;
  13.  
  14. ////////////////////////////////////////////////////
  15. int main()                                        //
  16. {
  17.  
  18.     printf(" sz    = %d\n",  sz   );
  19.     printf("&sz    = %d\n", &sz   );       
  20.     printf("&sz[0] = %d\n", &sz[0]);
  21.    
  22.    
  23.     printf(" psz   = %d\n",  psz);       
  24.     printf("&psz   = %d\n", &psz);   //  Только так смог взять адрес
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31. /*
  32.  
  33. #include     <stdio.h>
  34.  
  35.  
  36.  
  37. char sz [55] = "TDK",
  38.      sz2[55] = "DENON & ";
  39.  
  40.  
  41. void _strcat(char *, const char *kjllskfjalkj);
  42.  
  43. ////////////////////////////////////////////////////
  44. int main()                                        //
  45. {
  46.  
  47.     _strcat(sz2, sz);
  48.    
  49.      printf(sz2);
  50. }
  51.  
  52.  
  53.  
  54. ////////////////////////////////////////////////////
  55. void _strcat(char *psz1, const char *psz2)
  56. {
  57.    
  58.       int nLen1 = 0,
  59.           nLen2 = 0,
  60.           i     = 0;
  61.      
  62.       while(psz1[i] != 0) i++;  nLen1 = i;  i = 0;       
  63.       while(psz2[i] != 0) i++;  nLen2 = i;  i = 0; 
  64.      
  65.      
  66.       for(; i < nLen2; i++)
  67.       {
  68.          
  69.           psz1[nLen1+i] = psz2[i]; 
  70.       }
  71.    
  72. }
  73.  
  74. */
  75.  
  76.  
  77. /*
  78.  
  79. #include     <stdio.h>
  80.  
  81.  
  82.  
  83. char sz [55] = "TDK",
  84.      sz2[55];
  85.  
  86.  
  87. void szCipher(char *, const char *kjllskfjalkj);
  88.  
  89. ////////////////////////////////////////////////////
  90. int main()                                        //
  91. {
  92.  
  93.  
  94.     szCipher(sz2, sz);
  95.    
  96.     printf(sz2);
  97.  
  98. }
  99.  
  100.  
  101.  
  102. /////////////////////////////////////////////////////
  103. void szCipher(char *psz2, const char *psz1)
  104. {
  105.    
  106.     int i = 0;
  107.    
  108.     while(psz1[i])
  109.     {
  110.            
  111.         psz2[i] = psz1[i] - 1; 
  112.        
  113.         i++;
  114.     }
  115.    
  116.     psz2[i] = 0;  
  117.    
  118. }
  119.  
  120. */
  121.  
  122.  
  123.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement