Tuesday 15 March 2016

Suppose ted is a double variable. Declare a pointer that points to ted and use the pointer to display ted’s value.

Leave a Comment

Question:

Suppose ted is a double variable. Declare a pointer that points to ted and use the pointer to display ted’s  value.

Answer:

double * pd = &ted;
cout << *pd << "\n";

Source:

C++ Primer Plus Sixth Edition Chapter Review

If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: