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 


My for loop is not working c++

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

Joined: 20 Mar 2008
Posts: 533

PostPosted: Tue Nov 02, 2010 4:49 am    Post subject: My for loop is not working c++ Reply with quote

I'm trying to make a program, that calculates the total points in a problem and then divides it and then displays the grade.

However, the for loops in calculating will not execute at all, even when I tried testing it.
Code:
#include "stdafx.h"
#include <iostream>
using namespace std;


int *entryv;
int *negentry;
int source1;
int source2;
int source3[255];
int *total[255];
int miss[255];
int *lime;
int lemons;
int g = 0;
int brokenloop()
{
   for(int e = 0; e > 60; e++)
   {
      cout << "TEST";
   }
   return 0;
}
double calculation()
{
   cout << "The program will now tell you how many problems you need to miss to fail";
   brokenloop();
   return 0;
}
int main()
{
  entryv = &source1;
  negentry = &source2;
  lime = &lemons;
  for(int x = 0; x > 255; x++)
  {
     g++;
     total[x] = &source3[g];
  }
  cout << "Entering add Loops";
for (int e = 0; e < 60; e++)
{
  cin >> *entryv;
if(*entryv < 0)
{
cout << "The total is:" << *lime;
break;
}
*lime =  *entryv + *lime;

}
calculation();
}
Back to top
View user's profile Send private message
Jesper
Grandmaster Cheater Supreme
Reputation: 9

Joined: 21 Feb 2007
Posts: 1156

PostPosted: Tue Nov 02, 2010 7:26 am    Post subject: Reply with quote

Of course they aren't working, you're checking if the variable is HIGHER than not lower.

Code:

int brokenloop()
{
   for(int e = 0; e > 60; e++)
   {
      cout << "TEST";
   }
   return 0;
}


> should be changed to <
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