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 


C++ help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Wed Oct 10, 2007 1:28 am    Post subject: C++ help Reply with quote

well im a newby with c++ and i trying to learn
the program quit when you press any key when the "l4" shows
how to i make it repeat from stage 1 and save l4 value?

Code:

#include <iostream>
#include <conio.h>                                          
void main()

{
int l1,l3,l4,l5,l6,l7,l8,l9;

char lol;
std::cout<<"Welcome To My Calculator ..... it sux but anyway\nTal:";
//första talet
std::cin>> l1;

//vad man ska göra med det
std::cout<<"Vad:";
std::cin>> lol;

//vilket tal man ska göra det med
std::cout<<"Med:";
std::cin>> l3;
//visa talet
//---------------------------------------- +
if (lol == '+')
{
l4 = l1+l3;
}
//---------------------------------------- -
if (lol == '-')
{
l4 = l1-l3;
}
//---------------------------------------- *
if (lol == '*')
{
l4 = l1*l3;
}
//---------------------------------------- /
if (lol == '/')
{
l4 = l1/l3;
}



std::cout<<"Summa:"<<l4;

   ::_getch();
}

_________________
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: Wed Oct 10, 2007 7:16 am    Post subject: Re: C++ help Reply with quote

ups2000ups wrote:
how to i make it repeat from stage 1 and save l4 value?
Eg.
Code:
for(;;) { /* code goes here. */ }


Switch-case structure/function/operator/w/e it's would be way handier in this case. Or if you want to do it with if's, then you should use else if operator/w/e it's.

Yeps, I'm a bit lost with the terminology. :P

btw.. Those Swedish comments are a bit annoying :P
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