Empty program: Difference between revisions

From Rosetta Code
Content added Content deleted
(Program was missing formal arguments and a return code)
(argv is more of a "array of char * pointers" than a pointer to pointer)
Line 17: Line 17:
Compiler: [[GCC]] 4.0.3
Compiler: [[GCC]] 4.0.3


int main ( int argc, char ** argv) {
int main ( int argc, char * argv[]) {
return 0;
return 0;
}
}

Revision as of 19:00, 21 January 2007

Task
Empty program
You are encouraged to solve this task according to the task description, using any language you may know.

In this task, the goal is to create the simplest possible program that is still considered "correct."


Ada

Compiler: GCC 4.1.2

  procedure Empty is begin null; end;

Basic

Compiler: QBasic

  END

C

Compiler: GCC 4.0.3

int main ( int argc, char * argv[]) {
  return 0;
}

C++

Compiler: GCC 4.0.3

int main ( int argc, char *argv[] ) {
   return 0;
}

C#

Compiler: Microsoft (R) Visual C# 2005 Compiler version 8.00

static class Program
{
    static void Main(string[] args)
    {
    }
}

VB.NET

Compiler: Microsoft (R) Visual Basic Compiler version 8.0

Module General
    Sub Main()
    End Sub
End Module

Java

Compiler: GCJ 4.1.2

public class Empty {
  public static void main(String[] args) {
  }
}

LaTeX

Compiler: pdfeTeXk, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5), LaTeX2e <2003/12/01>

\documentclass{article}
\begin{document}
\end{document}

Pascal

Compiler: Borland Pascal

program ProgramName;

begin
end.


Perl

Interpreter: Perl 5.8.8

#!/usr/bin/perl

Python

Interpreter: Python 2.4.3

#!/usr/bin/env python

Ruby

Interpreter: Ruby 1.8.5

#!/usr/bin/env ruby

UNIX Shell

Interpreter: Debian Almquist SHell

#!/bin/sh

Interpreter: Bourne Again SHell

#!/bin/bash

xTalk

Interpreter: HyperCard

on startup
  
end startup