Oddworld Forums

Oddworld Forums (http://www.oddworldforums.net/index.php)
-   Off-Topic Discussion (http://www.oddworldforums.net/forumdisplay.php?f=9)
-   -   C++ (http://www.oddworldforums.net/showthread.php?t=20327)

STM 06-17-2011 03:28 AM

Yes but they are huge arduous codes that slow down playability of an exe.

furthermore, I would like to make sure the Command Prompt doesn't close for my text based application. At the moment I am using:

:

std::cout << " Press the enter key to exit at any time" ;
std:cin.ignore(std::cin.rdbuf()->in_avail() +1);
To keep the app working but I would rather the player press something like pressing '0' to end the game because primarily, you need people to enter a choice with 'enter' key, you cannot do this with the above code.

Manco 06-17-2011 03:30 AM

:

std::cout << " Press the 0 key to exit at any time" ;
std:cin.ignore(std::cin.rdbuf()->in_avail() +1);
I have no knowledge of C++, so I'm guessing I'm missing something here.

STM 06-17-2011 03:39 AM

Well yes I would have thought so, that's C++ code.

Nate 06-17-2011 04:52 AM

:

()
Yes but they are huge arduous codes that slow down playability of an exe.

furthermore, I would like to make sure the Command Prompt doesn't close for my text based application. At the moment I am using:

:

std::cout << " Press the enter key to exit at any time" ;
std:cin.ignore(std::cin.rdbuf()->in_avail() +1);
To keep the app working but I would rather the player press something like pressing '0' to end the game because primarily, you need people to enter a choice with 'enter' key, you cannot do this with the above code.

Use
system("PAUSE")

As for the line break issue, that's an issue to do with the console, not your program. I don't think that the Windows console width can be changed, so you're better off just tweaking your program to only have short output strings.

STM 06-17-2011 05:59 AM

Ok, thank you very much.

enchilado 06-22-2011 09:15 PM

What command line programme are you using?

Nate 06-23-2011 05:35 AM

:

()
What command line programme are you using?

Erm... do you mean 'compiler'?

STM 06-23-2011 02:50 PM

I use bloodshed for everything, it's the most fantastic programme.

Nate 06-23-2011 06:54 PM

Do you mean Dev-C++? 'Bloodshed' is the name of the developer, not the program. It's a nice little IDE, but I stopped using it when development died mid-beta, back in 2005ish.

I generally use Eclipse with the CDT plugin.

RoryF 06-23-2011 10:28 PM

:

()
it's the most fantastic programme.

I hope you were just joking when you spelt program like that. :happy:

STM 06-24-2011 05:26 AM

Yeh, for some reason it's in my head that program should be programme. I don't even know why.

Nate 06-24-2011 06:46 AM

In the U.K., all uses of the word programme except for 'computer program' should be spelled with the '-me'. In the U.S., 'program' is used for (almost) everything.

Source.


This exact sort of whining is what caused The Micallef Program (one of my favourite comedy shows of all time) to be renamed 'The Micallef Programme' for season 2. Then, for some reason, 'The Micallef Pogram' in the third season.

STM 06-24-2011 07:32 AM

Ah, well that's why I say programme then. In that case I'm going to use that more often instead of trying to correct myself.

Nate 06-24-2011 07:37 AM

Okay. Just as long as you know that you still used it incorrectly in this instance.

STM 06-24-2011 07:38 AM

Oh. Fuck.