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 


help c++ something is wrong
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Thu Sep 20, 2007 8:14 pm    Post subject: Reply with quote

But he's not prompting for info Rolling Eyes
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Thu Sep 20, 2007 9:30 pm    Post subject: Reply with quote

okay so whats the best way ? ... and whats the different?


Code:

#include <iostream>

using namespace std;

int main()
{
   cout<<"My first C++ program.\n";
   cin.get();
}


or

Code:

#include <iostream>
#include <conio.h>

int main()
{
    std::cout << "My first C++ program";

    ::_getch();
    return 0;
}

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Fri Sep 21, 2007 4:41 am    Post subject: Reply with quote

Code:
#include <iostream>

int main(int argc, char* argv[])
{
   std::cout << "My first C++ program.";
   std::cin.ignore();
   std::cin.sync();

   return EXIT_SUCCESS;
}
The best portable way IMO.

::_getch() is a nice one, but try compiling it on eg. some Linux distro. It won't work. Same thing with ::System("Pause"); and calling system functions is a bit dirty.

You'll spot the difference if you try continuing your program with some else key than enter. Eg. the button for A.
Back to top
View user's profile Send private message
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
Page 2 of 2

 
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