Advertisement
dllbridge

Untitled

Dec 10th, 2024
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.68 KB | None | 0 0
  1.  
  2. #include  <stdio.h>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. void foo(int *lkjkljkljlkjklj, int *);
  7.  
  8.  
  9.  
  10. /////////////////////////////////////////////////
  11. int main()
  12. {
  13.  
  14.     int  nMax =   123;
  15.     int *p    = &nMax;
  16.    
  17.     int nMinimum = 987;
  18.    
  19.     printf("(printf)p = %x\n", p);
  20.    
  21.     cout << "   *p = " << *p    << endl;
  22.     cout << "    p = " <<  p    << endl;   
  23.    
  24.     foo(p, &nMinimum); 
  25.    
  26. return 0;
  27. }
  28.  
  29.  
  30. ////////////////////////////////////////////////
  31. void foo(int *pnMax, int *p)
  32. {
  33.      
  34.     int RRR = *p;
  35.      
  36.     cout << " nMinimum = " <<   RRR   << endl;     
  37.     cout << "&nMinimum = " <<   p     << endl;  
  38.     cout << " nMax     = " <<  *pnMax << endl;     
  39.     cout << "&nMax     = " <<   pnMax << endl;          
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50. /*
  51. #include  <stdio.h>
  52. #include <iostream>
  53. using namespace std;
  54. void foo();
  55.  
  56. //#include      "f.h"
  57.  
  58.  
  59.  
  60. int  nMax =   123;
  61. int *p    = &nMax;
  62.  
  63.  
  64. /////////////////////////////////////////////////
  65. int main()
  66. {
  67.  
  68.  
  69.    
  70.     printf("(printf)p = %x\n", p);
  71.    
  72.     cout << "   *p = " << *p    << endl;
  73.     cout << "    p = " <<  p    << endl;   
  74.    
  75.     foo(); 
  76.    
  77. return 0;
  78. }
  79.  
  80.  
  81. ////////////////////////////////////////////////
  82. void foo()
  83. {
  84.     cout << " nMax = " <<  nMax << endl;       
  85.     cout << "&nMax = " << &nMax << endl;      
  86. }
  87. */
  88.  
  89. /*
  90.  
  91. #include  <stdio.h>
  92. #include <iostream>
  93. using namespace std;
  94.  
  95. int  nMax =   123;
  96. int *p    = &nMax;
  97.  
  98. /////////////////////////////////////////////////
  99. int main()
  100. {
  101.  
  102.  
  103.    
  104.     printf("(printf)p = %x\n", p);
  105.    
  106.     cout << "   *p = " << *p    << endl;
  107.     cout << "    p = " <<  p    << endl;   
  108.     cout << " nMax = " <<  nMax << endl;       
  109.     cout << "&nMax = " << &nMax << endl;       
  110.    
  111. return 0;
  112. }
  113.  
  114. */
  115.  
  116.  
  117.  
  118.  
  119.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement