Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


problem with dev C++
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
MasterChief
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Dec 2006
Posts: 1208
Location: Texas

PostPosted: Tue Apr 01, 2008 3:22 pm    Post subject: Reply with quote

wow i do it weird then i made it like this.

Code:
#include <iostream.h>

int main()

{
 
   cout << "hello world\n";
   return 0;
   cin>> exit;
}

And it would just wait for me to put in something before closing.


_________________
Back to top
View user's profile Send private message Yahoo Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Apr 01, 2008 5:03 pm    Post subject: Reply with quote

it would be a gift from god if that compiled.

also, cin would never be reached
Back to top
View user's profile Send private message
MasterChief
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Dec 2006
Posts: 1208
Location: Texas

PostPosted: Tue Apr 01, 2008 9:46 pm    Post subject: Reply with quote

slovach wrote:
it would be a gift from god if that compiled.

also, cin would never be reached


my bad i meant to put

string exit;

at the top, and since the cin isnt reached it doesnt close. Until you put in a character and hit enter.

_________________
Back to top
View user's profile Send private message Yahoo Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Apr 01, 2008 10:23 pm    Post subject: Reply with quote

You're never going to get to cin, ever, it's just going to exit.

Also, <iostream> not <iostream.h>

Also also, exit isn't defined
Back to top
View user's profile Send private message
MasterChief
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Dec 2006
Posts: 1208
Location: Texas

PostPosted: Wed Apr 02, 2008 12:07 am    Post subject: Reply with quote

slovach wrote:
You're never going to get to cin, ever, it's just going to exit.

Also, <iostream> not <iostream.h>

Also also, exit isn't defined


I said i meant to put string exit; at the top, but since its never defined it dont close. it wait until you put something in to close.

_________________
Back to top
View user's profile Send private message Yahoo Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Apr 02, 2008 12:21 am    Post subject: Reply with quote

thewiier wrote:
slovach wrote:
You're never going to get to cin, ever, it's just going to exit.

Also, <iostream> not <iostream.h>

Also also, exit isn't defined


I said i meant to put string exit; at the top, but since its never defined it dont close. it wait until you put something in to close.


You are still lost it seems, the code you posted above will never reach the input line. Your code was:

Code:
   cout << "hello world\n";
   return 0;
   cin>> exit;


You are returning before even attempting to use that cin line. Thus, the cin is useless and never called.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Negima
I post too much
Reputation: 6

Joined: 22 May 2007
Posts: 2222

PostPosted: Thu Apr 03, 2008 9:36 pm    Post subject: Reply with quote

Another question I have is how can I change colors in a console app? such as the text/background?
Back to top
View user's profile Send private message Visit poster's website
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Fri Apr 04, 2008 6:10 am    Post subject: Reply with quote

Negima wrote:
Another question I have is how can I change colors in a console app? such as the text/background?


Code:
#include <windows.h>
#include <iostream>

int main()
{
   // Obtain Console Handle
   HANDLE hConsoleHandle = GetStdHandle( STD_OUTPUT_HANDLE );


   // Make Loop To Output Color Combinations
   for( int x=0; x<255; x++ )
   {
      SetConsoleTextAttribute( hConsoleHandle, x );
      std::cout << "Hello this is a quick message. :) (Color Code: " << x << ")" << std::endl;
   }

   // Pause And Return
   std::cin.sync();
   std::cin.ignore();
   return 0;
}


Will loop from 0 to 254 and show you all the combinations for each number.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites