O'Reilly logo

C++ 2013 for C# Developers,Second Edition by Dean C. Wills

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 3

image

Syntax

The pure and simple truth is rarely pure and never simple.

—Oscar Wilde

The previous chapters emphasized the similarities between C# and C++/CLI. Now we touch on the main areas where they differ and begin to understand why. These include additional or different keywords, separators, and operators.

Keywords and Separators

In C++, the additional keyword namespace is required when using a namespace (see Table 3-1).

Table 3-1. Namespaces in C# and C++/CLI

C#

C++/CLI

using System.Threading;

using namespace System::Threading;

System.Console.WriteLine("H");

System::Console::WriteLine("H");

Moreover, where C# uses dot ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required