LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-21-2004, 11:14 PM   #16
Chris Weimer
Member
 
Registered: Jan 2004
Location: NYC
Distribution: Fedora XFCE
Posts: 91

Rep: Reputation: Disabled

# include <cstdio>

int main()
{
printf("Hello, World!");
getchar();
}
 
Old 02-21-2004, 11:15 PM   #17
chewysplace
Member
 
Registered: Sep 2003
Distribution: Slackware 10 w/ Kernel 2.6.8
Posts: 176

Rep: Reputation: 30
yeah, that prog that i posted here, compile it using g++ -Wall
 
Old 02-21-2004, 11:19 PM   #18
Longinus
Member
 
Registered: Sep 2003
Distribution: Redhat 9.0 && Slackware 9.1
Posts: 420

Original Poster
Rep: Reputation: 30
hrm what does the -Wall option do
 
Old 02-21-2004, 11:33 PM   #19
chewysplace
Member
 
Registered: Sep 2003
Distribution: Slackware 10 w/ Kernel 2.6.8
Posts: 176

Rep: Reputation: 30
Warning all. basicly it tells you everyting that is and might be wrong.
 
Old 02-22-2004, 11:00 PM   #20
jinksys
Member
 
Registered: Aug 2003
Location: 63123
Distribution: OpenSuSE/Ubuntu
Posts: 419

Rep: Reputation: 35
Quote:
Originally posted by Longinus
i guess g++ doesnt like the old header formats....
C++ headers do not have the .h extention. In your /usr/include/g++ directory you should
have iostream and backward/iostream.h. iostream.h basically just includes iostream and prints
the deprecated error.

So while your program will still work if you include iostream.h, its best to follow the standard and
include iostream.
 
Old 02-22-2004, 11:33 PM   #21
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Rep: Reputation: 45
Quote:
Originally posted by 320mb
Code:
#include <iostream>
#include <string>
using namespace std;

int main()
{
     printf("hello world");
     return 0;
}
worked for me , try it.....
It may be as simple as:
Code:
#include <iostream>
using namespace std;

int main()
{
     cout << hello world;
     return 0;
}
 
Old 02-22-2004, 11:56 PM   #22
jinksys
Member
 
Registered: Aug 2003
Location: 63123
Distribution: OpenSuSE/Ubuntu
Posts: 419

Rep: Reputation: 35
This wont work,
Code:
#include <iostream>
using namespace std;

int main()
{
     cout << hello world;
     return 0;
}
but this will...
Code:
#include <iostream>
using namespace std;

int main()
{
     cout << "hello world";
     return 0;
}
 
Old 02-22-2004, 11:58 PM   #23
Thetargos
Senior Member
 
Registered: Mar 2003
Location: Mexico City
Distribution: Fedora, Ubuntu & Mint
Posts: 1,679

Rep: Reputation: 45
Damn quotes, I keep forgetting them! :slap:
 
  


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
Hello World! StephenCM LinuxQuestions.org Member Intro 9 01-14-2005 12:59 PM
A whole new world 8oluf7 LinuxQuestions.org Member Intro 2 01-08-2005 06:36 AM
Hello World! professor_x_00 LinuxQuestions.org Member Intro 5 03-24-2004 05:51 AM
world writeable files will not stay world writeable antken Mandriva 1 03-02-2004 05:04 PM
Hello World! flaw Linux - Newbie 6 09-19-2002 02:54 AM

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

All times are GMT -5. The time now is 01:37 AM.

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