Jump to content
  • Advertisement
Sign in to follow this  
Doom-Box

PROBLEM!

This topic is 4850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Ok you guys are probably sick of me already but here I go again. I was trying to do Hello World again. Instead of (my outdated) books I tried to use the valuable internet. And well I found a tutoroal that explains the code and I dont know whats wrong. #include <iostreame> using namespace std; int main() { Cout<<"Hey Im alive and Oh, Hellow World!\n"; cin. get(); } Can someone remind me how to put in the codeboxes?

Share this post


Link to post
Share on other sites
Advertisement
1. You put your code in [ source ] tags. (Without the spaces). Read the faq.
2. You need to use "cout", not "Cout". C++ is case sensitive.
3. No space after between "cin" and ".get".
4. Typo in header name: <iostream>, not <iostreame>.
5. Need to return a value - add return 0; before finishing the main function.
6. Even for small problems like this, it's better if you actually post the errors you receive when compiling. Also, use an actually descriptive post title.


#include <iostream>

using namespace std;

int main()
{
cout << "Hey Im alive and Oh, Hellow World!\n";
cin.get();
return 0;
}

Share this post


Link to post
Share on other sites
Quote:
Original post by Doom-Box
code:
#include <iostreame>

using namespace std;

int main()
{

Cout<<"Hey Im alive and Oh, Hellow World!\n";
cin. get();

}

If this is a copy/pasted from your IDE, then there's a few mistakes.

#include <iostreame>   // should be "#include <iostream>" (no quotes)
...
cin. get(); // should not have a space after the period
...
} // you need to return something from main before this closing bracket

Other than those, you're on the right track. Hope this helps.

:stylin:
Quote:
Can someone remind me how to put in the codeboxes?

(left bracket)source(right bracket)
... stuff ...
(left bracket)/source(right bracket)

EDIT: beat by mattd

Share this post


Link to post
Share on other sites
OK I think there is a serious problem with this website or the compiler...(its free what can I say) I copied and pasted the file just now and it still came up with errors and Im not sure whats wrong is someone could link me to a good website and a compiler (please free if at all possible im still a student and dont have a credit card). These both would be very helpfull.

Share this post


Link to post
Share on other sites
Ahh eek sry guys. I just tried it again and found the problem im totally new at this so I apolgize for wasting your guys time.

Share this post


Link to post
Share on other sites
Quote:
Original post by tgraupmann
void main() { }


No, not in C++.

To the OP: Please at least consider trying to *read* the error messages. Consult a dictionary if necessary.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!