News:

Come Chat with us live! Learn how HERE!

Main Menu

"Hello World" Series

Started by KillerWhale, October 28, 2009, 04:19:59 PM

Celestial_Rage

Quote from: Rocinante on October 29, 2009, 04:59:46 PM

#!/bin/bash
echo "Hello, world"
exit 0


Aww, I was going to use bash :(

Oh well, FoxProx, works fine..


print "Hello World"
end
"The reports of my death are greatly exaggerated" ~Mark Twain

KillerWhale

Disp "HELLO WORLD"

OWNED TI-BASIC!

Cadynum


gimhael


main = putStrLn.unwords$["Hello","World"]

MitSugna

hell = require('helloWorld')
if hell =~ nil then hell.run()
else print('Hello World')
end

A Spork

#include <iostream.h>

void main()
{
    cout << "Hello, world!";
}
Don't shoot friend :basilisk:! Friend :basilisk: only wants to give you hugz and to be your hat

Proud Member of the S.O.B.F.O.B.S.A.D: The Society Of Basilisks For Other Basilisks Safety and Dominance
:basilisk:    :basilisk:    :basilisk:

Amanieu

STOP ABUSING THE BIT SHIFT OPERATOR >:(
Quote
< kevlarman> zakk is getting his patches from shady frenchmen on irc
< kevlarman> this can't be a good sign :P

AppleJuice

Quote from: A Spork on November 03, 2009, 08:35:03 PM
#include <iostream>

int main() {
   std::cout << "Hello, world!\n";
}

Fixed
Currently: {&}AppleJuice

A Spork

#38
Mine is C++, and it works.
(And your version fails btw, no return statement)
Don't shoot friend :basilisk:! Friend :basilisk: only wants to give you hugz and to be your hat

Proud Member of the S.O.B.F.O.B.S.A.D: The Society Of Basilisks For Other Basilisks Safety and Dominance
:basilisk:    :basilisk:    :basilisk:

AppleJuice

Quote from: A Spork on November 04, 2009, 07:17:43 PM
Meh, it works either way.
(And your version fails btw, no return statement)

No.
http://www2.research.att.com/~bs/bs_faq2.html
http://www2.research.att.com/~bs/bs_faq2.html#void-main

"In C++, main() need not contain an explicit return statement. In that case, the value returned is 0, meaning successful execution."
This also includes reasons as to why your version is not good.

There's some reading for you. :)

Btw, your version doesn't compile with g++ -ansi -pedantic -Wall
Currently: {&}AppleJuice

A Spork

whatever.
It worked for me, and thats what I was taught.
Don't shoot friend :basilisk:! Friend :basilisk: only wants to give you hugz and to be your hat

Proud Member of the S.O.B.F.O.B.S.A.D: The Society Of Basilisks For Other Basilisks Safety and Dominance
:basilisk:    :basilisk:    :basilisk:

AppleJuice

Worked in which programming environment?
Currently: {&}AppleJuice

A Spork

C++
Couldn't tell you what program off the top of my head....
Don't shoot friend :basilisk:! Friend :basilisk: only wants to give you hugz and to be your hat

Proud Member of the S.O.B.F.O.B.S.A.D: The Society Of Basilisks For Other Basilisks Safety and Dominance
:basilisk:    :basilisk:    :basilisk:

AppleJuice

Quote from: A Spork on November 04, 2009, 09:56:53 PM
C++

Dude, I obviously know it's C++...



someone use a Visual Basic GUI to track the IP
Currently: {&}AppleJuice

3of12

Scratch that, wrong problem.

IabzO.o

Quote from: AppleJuice on November 04, 2009, 10:17:05 PM
Quote from: A Spork on November 04, 2009, 09:56:53 PM
C++

Dude, I obviously know it's C++...



someone use a Visual Basic GUI to track the IP

imsrybrobutitsnotsoobvious
POWA SUKC AT TRMELUS

I AM JESUS

MitSugna

Quote from: AppleJuice on November 04, 2009, 07:00:53 PM
Quote from: A Spork on November 03, 2009, 08:35:03 PM
#include <iostream>

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

Fixed
Dunno if fixed or correct but that is what I'd do
( Also using std::endl instead of '\\n' makes you look cooler :P )