C++ Pointer Change Variable via a Pointer Variable

Description

C++ Pointer Change Variable via a Pointer Variable

#include <iostream> 

using namespace std; 

int main() //from  www. j  a v a 2s . c  o  m
{ 
  int a = 100; 
  int *ptr; 

  ptr = &a; 

  *ptr = 60; 

  cout << a << endl; 

  return 0; 
}



PreviousNext

Related