Chưa phân loại

C/C++/CLI Hello world project

Hi everyone, just take a minute to see this code.

#include <string>		// For string
#include <iostream>     // For cin
#include <stdio.h>	// For printf

using namespace System;		// For Console
using namespace std;		// For string, cin

int main() {
	string yourName;
	Console::Write("Enter your name: ");
	cin &gt;&gt; yourName;
	printf("Hello %s. Welcome to C/C++/CLI world.", yourName.c_str());
	Console::ReadKey();
	return 0;
}

The result is:
Enter your name: Edward
Hello Edward. Welcome to C/C++/CLI world.

We found 3 languages just in less than 10 lines code.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s