Advertisement
GreMendes

Comparar valor dos ponteiros

Aug 18th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main(){
  4.  
  5.     int *ptr1;
  6.     int *ptr2;
  7.  
  8.     int a, b;
  9.    
  10.     std::cin >> a;
  11.     std::cin >> b;
  12.    
  13.  
  14.  
  15.     if(*ptr1 > *ptr2){
  16.         std::cout << "Ponteiro 1 e maior!";
  17.     }
  18.     else if(*prt1 < *ptr2){
  19.         std::cout << "Ponteiro 2 e maior!";
  20.     }
  21.     else{
  22.         std::cout << "Os ponteiros sao iguais!";
  23.     }
  24.  
  25.  
  26.  
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement