Skip to main content

Boxing/Unboxing

  • Chapter
  • First Online:
C++/CLI Primer
  • 1513 Accesses

Abstract

As we saw earlier, Value Types are allocated on the stack. There are times when they are present on the managed heap. For instance, when a method takes a System::Object (the mother of all managed types) as the parameter for, say, printing the contents, an object is allocated on the heap with the value of the Value Type copied to it. This process is called boxing.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 14.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 22.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Vivek Ragunathan

About this chapter

Cite this chapter

Ragunathan, V. (2016). Boxing/Unboxing. In: C++/CLI Primer. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-2367-3_12

Download citation

Publish with us

Policies and ethics