SergeyNasekin

Pointers Exercise 1

May 24th, 2021 (edited)
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. //Exercise 1
  2. #include <iostream>
  3. int main() {
  4.     float value = 0;
  5.     float *pValue = &value;
  6.     std::cout << "Enter value: ";
  7.     std::cin >> value;
  8.     std::cout << "\nPointer value = " << *pValue << std::endl;
  9.     *pValue +=2;
  10.     std::cout << "Pointer value + 2 = " << *pValue << std::endl;
  11. }
Add Comment
Please, Sign In to add comment