Advertisement
dllbridge

Untitled

Apr 20th, 2025
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.44 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include <iostream>
  5. using namespace std;
  6.  
  7.  
  8. void monitor(int &r);
  9.  
  10.  
  11. ////////////////////////////////////////////////////////////////
  12. int main()
  13. {
  14.     int nArr[99] = {22, 2, 4, 6, 7, 5, 3, 5, 61, 83};
  15.    
  16.     monitor(nArr[1]);
  17.    
  18.    
  19.    
  20. return 0;
  21. }
  22.  
  23.  
  24.  
  25. //////////////////////////////////////////////////////////////
  26. void monitor(int &r)
  27. {
  28.      cout << "nArr[1] = " << r << endl;
  29.      
  30.      int *p = &r;
  31.      
  32.      p--;
  33.      
  34.      for(int i = 0; i < 10; i++)
  35.      {
  36.              
  37.              
  38.         cout << *(++p) << endl;
  39.        // p++;        
  40.      }
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. //                                                                             (   )      
  49. //                                                                            (    )
  50. //                                                                             (    )
  51. //                                                                            (    )
  52. //                                                                              )  )
  53. //                                                                             (  (                  /\
  54. //                                                                              (_)                 /  \  /\
  55. //                                                                      ________[_]________      /\/    \/  \
  56. //                                                             /\      /\        ______    \    /   /\/\  /\/\
  57. //                                                            /  \    //_\       \    /\    \  /\/\/    \/    \
  58. //                                                     /\    / /\/\  //___\       \__/  \    \/
  59. //                                                    /  \  /\/    \//_____\       \ |[]|     \
  60. //                                                   /\/\/\/       //_______\       \|__|      \
  61. //                                                  /      \      /XXXXXXXXXX\                  \
  62. //                                                          \    /_I_II  I__I_\__________________\
  63. //                                                                 I_I|  I__I_____[]_|_[]_____I
  64. //                                                                 I_II  I__I_____[]_|_[]_____I
  65. //                                                                 I II__I  I     XXXXXXX     I
  66. //                                                               E-mail:    [email protected]                
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81. /*
  82.  
  83. #include     <stdio.h>
  84. #include   <windows.h>
  85.  
  86.  
  87. int _RGB(unsigned char R, unsigned char G, unsigned char B);
  88.  
  89. /////////////////////////////////////////////////////////
  90. int main()
  91. {
  92.    
  93.     int n = _RGB(1, 2, 3);
  94.                    
  95.     printf("n = %d\n", n);  
  96.     printf("n = %x\n", n);
  97.      
  98. return 0;
  99. }
  100.  
  101.  
  102.  
  103. /////////////////////////////////////////////////////////
  104. int _RGB(unsigned char R, unsigned char G, unsigned char B)
  105. {
  106.    
  107.      int nRes = 0;
  108.    
  109.                         nRes  = B;
  110.      nRes = nRes << 8;  nRes += G;
  111.      nRes = nRes << 8;  nRes += R;
  112.      
  113. return nRes;      
  114. }
  115.  
  116.  
  117. */
  118.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement