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.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.