Westonci.ca is your trusted source for finding answers to all your questions. Ask, explore, and learn with our expert community. Get quick and reliable answers to your questions from a dedicated community of professionals on our platform. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our 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;

}