Touble with hello world

Mar 4, 2011 at 12:34am
I was told to make my own thread and here is my problem:
I tried making hello world after reading a few tutorials.
I did this:
<include> #iostream
using std namespace
main int() (
cout >> "Hello" >> end;
return 0
)
)
It never compiles. What the heck did I do wrong?
Mar 4, 2011 at 12:35am
Did you look at my response?
Disch wrote:
Protip: When code doesn't compile, the compiler error tells you the reason why.


Edit: At least post the compiler errors.
Last edited on Mar 4, 2011 at 12:36am
Mar 4, 2011 at 12:37am
Awooga.
Mar 4, 2011 at 12:40am
Line 1: error: stray '#' in program
is the only thing im getting now
Mar 4, 2011 at 12:46am
Mar 4, 2011 at 12:53am
change using std namespace to using namespace std; don't forget the ; thingy!
oh yeah and like moschops says the # goes before include.
Last edited on Mar 4, 2011 at 12:54am
Mar 4, 2011 at 1:04am
Come on guys, the hello world example is something you just mind c&p from some book or a website - there is no way someone can mess up this few lines so bad without wanting to do so.

In case I am wrong, here this is what it should look like. Compare to what it looks like with your code (and do something about your attention span):

1
2
3
4
5
6
7
#include <iostream>
using namespace std;
int main()
{
cout<<"Hello"<<endl;
return 0;
}
Last edited on Mar 4, 2011 at 1:04am
Mar 4, 2011 at 1:12am
You don't need to be such an ass, but thanks i guess
Mar 4, 2011 at 1:16am
What part about saying that a person, that doesn't manage to correctly copy 6 lines of text (actually, just a single line, considering that not even one of them was correct) and has subsequently go to a forum to seek advice on how to copy 6 lines of text, can't be real is being an ass?
Last edited on Mar 4, 2011 at 1:18am
Mar 4, 2011 at 1:18am
I tried to do it off the top of my head, not copying the text. I didn't want to look it up so I learned something from it
Mar 4, 2011 at 1:21am
So, rather than realizing your memory failed you and looking it up, you go to a forum and ask others for help because that helps you learning it more?

I guess we should call it quits here, no need to keep bumping this thread for nonsense chat.
Mar 4, 2011 at 1:22am
dicks
Mar 4, 2011 at 1:42am
seriously that was the most noobish mistake I have ever seen in my life I mean you screwed up HELLO @#$%ing WORLD!!!!!! some of us try helping then you go and be an idiot about it. I am pretty sure that after this no one is ever going to help you again. may I ask: Where did you get this tutorial?
Mar 4, 2011 at 1:47am
Come on, stop bashing him. He can make noobish mistakes because he is a noob. I'm sure everyone lacks their common sense every now and then.

Edit: I must say it does appear a little intentional though.
Last edited on Mar 4, 2011 at 1:49am
Mar 4, 2011 at 1:52am
I have no problem with a noob mistake but when he starts calling people who help him ass's then its goes from ignorance to retartedness.
Mar 4, 2011 at 1:52am
hanst99, bboy212, leave him alone. This is not helping the atmosphere we'd like to have around here, which is to say a friendly non-acusatory climate where one can make even the most severe mistakes and not get mocked for it.

However, chaoschief, they are right. There isn't a single line in that piece of code without an error; mostly you have a problem with putting things in the correct order. A few tips:

*The brackets are {}, not ()
*To read into cout use <<
*#include <iostream>
*int main()
*http://www.cplusplus.com/doc/tutorial/program_structure/

Best of luck!

-Albatross
Last edited on Mar 4, 2011 at 1:54am
Topic archived. No new replies allowed.