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 with farnheit converter

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

Joined: 25 Apr 2008
Posts: 691
Location: Canada

PostPosted: Tue Oct 28, 2008 7:33 pm    Post subject: help with farnheit converter Reply with quote

i had errors i just fixed em
i need help though when it converts you press a button it closes heres the code it works fine though

#include <cstdlib>
#include <iostream>
using namespace std;

int main(int nNumberofArgs,char* pszArgs[])
{
int Celsius;
cout << "enter the temperature in Celsius :";
cin>> Celsius;
int factor;
factor = 212 - 32;

int Fahrenheit;
Fahrenheit = factor * Celsius/100 + 32;

cout << "Fahrenheit value is :";
cout << Fahrenheit << endl;
system("PAUSE");
return 0;
}
Back to top
View user's profile Send private message AIM Address MSN Messenger
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Tue Oct 28, 2008 8:16 pm    Post subject: Reply with quote

Don't use system("pause")
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Tue Oct 28, 2008 8:18 pm    Post subject: Reply with quote

Thats because you aren't looping or anything.
Programs only go in 1 direction, so since you don't have a loop surrounding anything it will print the Fahrenheit then do the pause, then return 0 (exit).

Btw, don't use system("pause"), its the worst way.

Use:

cin.sync();
cin.ignore();

instead.

_________________
Back to top
View user's profile Send private message
kitterz
Grandmaster Cheater Supreme
Reputation: 0

Joined: 24 Dec 2007
Posts: 1268

PostPosted: Tue Oct 28, 2008 8:18 pm    Post subject: Reply with quote

slovach wrote:
Don't use system("pause")


I agree...use something else.

_________________
Back to top
View user's profile Send private message Send e-mail
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Wed Oct 29, 2008 4:42 am    Post subject: Reply with quote

I use getch() from conio.h Wink
_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
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
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