Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

int i = 42, *p = &i, &r = i; decltype (*p) c; // error: c is int& and must be initialized Above is the

int i = 42, *p = &i, &r = i;

decltype (*p) c; // error: c is int& and must be initialized

Above is the an example of C++ decltype. I know with the asterisk*, we are dereferencing the pointer p and we get the object to which the pointer p points. But how does decltype (*p) end up with an int& type, but not a plain int?

Thank you, will upvote for a detailed answer.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Neo4j Data Modeling

Authors: Steve Hoberman ,David Fauth

1st Edition

1634621913, 978-1634621915

More Books

Students also viewed these Databases questions

Question

What is meant by Career Planning and development ?

Answered: 1 week ago

Question

What are Fringe Benefits ? List out some.

Answered: 1 week ago