Touble with hello world

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?
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
Awooga.
Line 1: error: stray '#' in program
is the only thing im getting now
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
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
You don't need to be such an ass, but thanks i guess
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
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
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.
dicks
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?
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
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.
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
Topic archived. No new replies allowed.