Tutorial - C / C++ - Hello World!! Classic


Coding Friends Tutorial Index - > C / C++

Author Ian - Tutorial Posts = 62
You can obtain a few version of a c/c++ compiler from http://gcc.gnu.org/, but if you are using http://www.designersoft.co.uk/linux.html then you should have the compiler already installed.

To display the classic Hello World, save this code below
----
#include <stdio.h>

int main(void)
{
       printf("Hello world!!");       
}
----
as helloworld.c

Then to compile (if using gcc) into the platform that you are using
gcc helloworld.c -o helloworld

to run the program, you just need to execute the helloworld file that was created from the above command, if you are using Windows, then you will need to change the line to
gcc helloworld.c -o helloworld.exe
since Windows prefers to have the *.exe at the end of the filenames.

The output should be
Hello world!!

Well that is the classic!!
Creation of cool tutorials :)
User Name Password
Copyright@CodingFriends, 2005-2006. All Rights Reserved.
Home | Forums | Tutorials | Users
RSS Feeds - Global Global CodingFriends RSS Feed - Tutorials Tutorials CodingFriends RSS Feed - Forums Forums CodingFriends RSS Feed - News News CodingFriends RSS Feed
Users
Login|Password problem| Register here

Tutorials
Tutorials Home| C/C++| C#/Mono| Java| Javascript| PHP| Ruby| SQL| (X)HTML/CSS| VB| Linux| Windows

Forum
Forum Home

Projects
3D Game

Site
Home| About me| Links| FAQ

Search