CHAPTER 31

image

Other Language Details

This chapter deals with some miscellaneous details about the language, including how to use the Main() function, how the preprocessor works, and how to write literal values.

The Main Function

The simplest version of the Main() function should already be familiar from earlier in the book.

using System;class Test{    public static void Main()    {       Console.WriteLine("Hello, Universe!");    }}

Returning an Int Status

It may sometimes be useful to return a status from the Main() function, particularly if the program is called programmatically, because the return status can be used to determine whether the application ...

Get A Programmer's Guide to C# 5.0, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.