Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 13. Properties > Chapter 13 Quick Reference

Chapter 13 Quick Reference

ToDo this
Create a property for a C++ class.Use the __property keyword with get and set methods. For example:
     __property void set_Weight(int n) { ...}
     __property int get_Weight() { ... }

Implement a read-only property.Implement only the get method.
Implement a write-only property.Implement only the set method.
Implement an indexed property.Implement a property whose get and set methods take parameters that are used to determine which value to get or set. For example:
     __property void set_Pay(Person*, Amount*);
     __property Amount* get_Pay(Person*);



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial