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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.