Get expert advice and community support on IDNLearn.com. Get prompt and accurate answers to your questions from our community of knowledgeable experts.

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;

}