Discover answers to your most pressing questions at Westonci.ca, the ultimate Q&A platform that connects you with expert solutions. Join our Q&A platform to connect with experts dedicated to providing precise answers to your questions in different areas. Explore comprehensive solutions to your questions from a wide range of professionals on our user-friendly platform.

Write a program that defines an object of type double. Define a pointer that points to that
object. Print the value of the pointed-to object by dereferencing a pointer.


Sagot :

Answer:

#include <iostream>

using namespace std;

int main()

{

   //make a double

   double object = 1.5;

   //make a pointer

   double* pointer;

   //make the pointer point to address of the object

   pointer = &object;

   //print by dereferencing a pointer

   cout<<*pointer;

   return 0;

}