Jump to content
  • Advertisement
Sign in to follow this  
Kryshu

Help Please

This topic is 4844 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

Could someone please explain this to me .... me and my bud are using the same compiler Dev-C++ but were both using diff books.... we wanted to try the different code meathods out of each book so i tried the codes his book game for game over and it doesnt work //Game Over #include (iostream) using namespace std; int main() { cout << "Game Over"; cin.get(); } its the exact same on his comp and it works for him but not for me.. please help

Share this post


Link to post
Share on other sites
Advertisement
i did have it like that include <iostream> for sum reason when i copy pasted it i guess it changed it to brackets :S

Share this post


Link to post
Share on other sites
Quote:
Original post by Kryshu
i did have it like that include <iostream> for sum reason when i copy pasted it i guess it changed it to brackets :S


You should post all code inside of the code or source tags
[ code ]Your Code Here [ / code ]
[ source ] Your Code Here [ / source]
(Without the spaces)

Code tags looks like this:

int foo()
{
return 10;
}


Source tags look like this:

int foo()
{
return 10;
}

Share this post


Link to post
Share on other sites
If your compiler is set up any diffrent then his you may need to use:

#include <iostream.h>

instead of

#include <iostream>

Share this post


Link to post
Share on other sites
Quote:
Original post by t5hoo6
If your compiler is set up any diffrent then his you may need to use:

#include <iostream.h>

instead of

#include <iostream>


For the love of god, NO!

Using iostream.h is NEVER appropriate, unless you want to invent obscene scenarios where you are required by your boss to use a non-standards compliant compiler and since these guys are just starting to learn we know that is not the case.

iosream (no .h) is the official filename of the c++ standard library header of input and output streams(ie, cout and cin) The standard's commity decided to wrap all the standard stuff into a namespace. A namespace is basically a special way of organizing a group of code. The standard stuff is in namesapce std which means all the code is part of the standard. That shouldn't be the problem, because you are 'using' that standard namespace already and using the appropriate file(iostream)

iostream.h was the file that was used by many compilers before the standard was finished and therefore you shouldn't use it if you wish to write correct code. Besides, a compiler many not even HAVE iostream.h(it doesn't need to, it's not standard!)

Okay, now you should listen to Konfusius and tell us how it isn't working... what error messages do you get?

Share this post


Link to post
Share on other sites
Yeah, what are the errors you get? Then we might be-able to tell, but from what I can see the only problem is the (iostream). It should be(as you said you had it as)<iostream>. What version of Dev-CPP are you using? If you don't have the latest version, then switch to that.


Chad.

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!