Skip to main content

Types, Storage, and Variables

  • Chapter
Illustrated C# 2012
  • 2464 Accesses

Abstract

If you were to broadly characterize the source code of C and C++ programs, you might say that a C program is a set of functions and datatypes and that a C++ program is a set of functions and classes. A C# program, however, is a set of type declarations.

  • The source code of a C# program or DLL is a set of one or more type declarations.

  • For an executable, one of the types declared must be a class that includes a method called Main.

  • A namespace is a way of grouping a related set of type declarations and giving the group a name. Since your program is a related set of type declarations, you will generally declare your program type inside a namespace you create.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Daniel M. Solis

About this chapter

Cite this chapter

Solis, D.M. (2012). Types, Storage, and Variables. In: Illustrated C# 2012. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4279-6_3

Download citation

Publish with us

Policies and ethics