CHAPTER 1

image

Hello, World

Consistency is the last refuge of the unimaginative.

—Oscar Wilde

Since time immemorial, which pretty much dates back to the release of the Kernighan and Richie book on C, there has been a tradition of opening a book on C or its descendants with a short example of how easy it is to display “Hello World”. This book is no exception. Let’s examine the C# and C++ versions of “Hello World” side by side (see Table 1-1).

Table 1-1. “Hello World” in C# and C++

C#

C++

using System;class HelloWorld{   static void Main()   {     Console.WriteLine(“Hello World”);   }}

using namespace System;void main(){     Console::WriteLine(“Hello ...

Get C++ 2013 for C# Developers,Second 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.