Discover answers to your questions with Westonci.ca, the leading Q&A platform that connects you with knowledgeable experts. Discover in-depth answers to your questions from a wide network of experts on our user-friendly Q&A platform. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately.

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;

}