LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-27-2002, 01:02 PM   #1
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 516

Rep: Reputation: 32
simple "Hello World" sample in C please


Could someone please post a simple "Hello World", and how to complie/link it etc.

#include<stdio.h>

void main()
{
printf("hello\n");
}

as above with step by step instructions on how to make a binary in Linux.

Thanks in advance!
 
Old 02-27-2002, 01:21 PM   #2
pperon
Member
 
Registered: Jan 2002
Location: Cleveland
Distribution: Gentoo and umm... Gentoo
Posts: 64

Rep: Reputation: 15
gcc -Wall -o hello hello.c
./hello

That's it.

PS. readme
 
Old 02-27-2002, 01:36 PM   #3
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 270Reputation: 270Reputation: 270
Re: simple "Hello World" sample in C please

Quote:
Originally posted by plisken
as above with step by step instructions on how to make a binary in Linux.
make it executable.. read up on how to change file permissions with chmod.

-trickykid

oops, thought you meant make it executable.. oh well. that link to a book will help you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
running "hello world" in ARM Integrator Board ayeong Linux - Newbie 4 09-12-2006 02:01 AM
Sample "Hello World" Xwindows C++ program dogpatch Programming 1 12-02-2005 08:55 AM
What ever happened to the "smallest computer in the world"? t3gah General 3 04-21-2005 10:06 PM
Error with evolution after "emerge -u world" PGDubbin Linux - Software 4 01-28-2005 08:41 AM
Installing Debian on a Powerbook G3 "Old World" plbowler Debian 12 09-28-2004 06:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration