Posted: Tue Nov 02, 2010 4:49 am Post subject: My for loop is not working c++
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;
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