Question

C++ Both the dot-notation and the arrow-notation can be used to refer to fields of C++...

C++ Both the dot-notation and the arrow-notation can be used to refer to fields of C++ structures. When would you use the dot-notation, and when the arrow-notation?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

dot can be used in the c++ structure member object only

arrow can be used in the c++ pointer to an object

#source code in c++ example of dot

1 2 3 4 Ол 6 7 8 9 10 11 #include <iostream> using namespace std; struct Data{ int n; }; int main() { struct Data p; p.n=20;

#example of arrow

1 2 3 4 5 6 7 8 9 10 11 12 #include <iostream> using namespace std; struct Data{ int n; }; struct Data *p=NULL; int main() {

#if you have any doubt or more information needed comment below...i will respond as possible as soon...thanks....

Add a comment
Know the answer?
Add Answer to:
C++ Both the dot-notation and the arrow-notation can be used to refer to fields of C++...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT