c#

You are currently browsing articles tagged c#.

Pasang pakej g++ sebagai root
su -
aptitude install g++

Untuk compile fail hello.cpp yang kandungannya seperti berikut

#include <iostream>
using namespace std;

int main ()
{
	cout << "Hello, world." << endl;
	return 0;
}

Arahannya seperti berikut:
g++ hello.cpp -o hello

Sengaja saya tambah pilihan dan parameter -o hello supaya program terhasil bernama hello, bukannya a.out. Untuk laksanakan program terhasil:
./hello

Hasil sepatutnya:

Hello, world.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Tags: , , ,

Untuk compile kod C#, gunakan mcs dari pakej mono-mcs

Katakan kod sumber adalah kod.cs dengan kandungan seperti berikut

using System;

class Hello {
	static void Main() {
		Console.WriteLine ("Hello, World!");
	}
}

Compile kod seperti berikut:
mcs kod.cs

Fail executable/essembly bernama kod.exe akan terhasil. Untuk uji essembly tersebut:
./kod.exe

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Tags: ,