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 


I would like some 'guidance' on what I'm working on.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
saintpat123
Cheater
Reputation: 0

Joined: 15 Jan 2007
Posts: 29
Location: In my room. Or in yours?

PostPosted: Thu Apr 03, 2008 8:35 pm    Post subject: I would like some 'guidance' on what I'm working on. Reply with quote

Hi my friend and I are currently trying to learn C++. Now I just made a couple of little programs and I was just curious as to how I could make a GUI for some of them? If anyone could help I would be much abliged. Thank you in advance.
_________________
Heh I just owned j00 Smile
Back to top
View user's profile Send private message AIM Address
Travis13
Expert Cheater
Reputation: 0

Joined: 17 Feb 2007
Posts: 199

PostPosted: Thu Apr 03, 2008 8:37 pm    Post subject: Reply with quote

im his friend and we basically wanna know how to make a gui from a simple source, he will include our source in a second

EDIT: this is it

Code:
#include "main.h"
#include <iostream>
using namespace std;
int main(void)
{
   system("TITLE The Battle!");
   system("COLOR 5");

   char cInput;

   cout << "Maplestory Owns!" << endl;
   cout << "Is this true? (y or n)" << endl;
   cin >> cInput;

   if(cInput == 'Y'||cInput == 'y')
      cout << "You are totally correct!" << endl;
   else
      cout << "YEAH!" << endl;

   system("PAUSE");
   return 0;
}

main::~main(void)
{
}
Back to top
View user's profile Send private message MSN Messenger
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

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

First of all, that looks like it would be a console prog. Use createwindowEX.
Back to top
View user's profile Send private message AIM Address MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

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

Travis13 wrote:
im his friend and we basically wanna know how to make a gui from a simple source, he will include our source in a second

EDIT: this is it

Code:
#include "main.h"
#include <iostream>
using namespace std;
int main(void)
{
   system("TITLE The Battle!");
   system("COLOR 5");

   char cInput;

   cout << "Maplestory Owns!" << endl;
   cout << "Is this true? (y or n)" << endl;
   cin >> cInput;

   if(cInput == 'Y'||cInput == 'y')
      cout << "You are totally correct!" << endl;
   else
      cout << "YEAH!" << endl;

   system("PAUSE");
   return 0;
}

main::~main(void)
{
}


Some suggestions:
- Ditch main.h (you really don't need it for this.)
- Delete the main::~main(void) deconstructor, don't need it either.
- Remove 'using namespace std;' and just use std:: infront of the iostream members.
- Don't use system("pause") to pause the console, firstly, it wastes resources and loads things into the memory of your program that you doesn't need. Instead, you can already use whats given to you in the iostream header:

Code:
std::cin.sync();
std::cin.ignore();

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
saintpat123
Cheater
Reputation: 0

Joined: 15 Jan 2007
Posts: 29
Location: In my room. Or in yours?

PostPosted: Fri Apr 04, 2008 3:47 pm    Post subject: Reply with quote

ok I am sorry but me and my friend are BRAND new to C++ I understand everything you said except what do std::cin.sync(); and std::cin.ignore(): exactly do?
_________________
Heh I just owned j00 Smile
Back to top
View user's profile Send private message AIM Address
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Apr 05, 2008 3:01 pm    Post subject: Reply with quote

Ignore:
http://www.cplusplus.com/reference/iostream/istream/ignore.html

Sync:
http://www.cplusplus.com/reference/iostream/istream/sync.html

_________________
- 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
Page 1 of 1

 
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