Click to See Complete Forum and Search --> : While loop does not run!


mikee32
June 8th, 2008, 02:52 PM
So I wrote a simple program that I hope to build up slowly. It's very (very) simple! Here it is:

#include <iostream>
using namespace std;
int i_EXIT;
int Fi_EXIT();

int main(){
i_EXIT=0;
while (i_EXIT=0) {
Fi_EXIT();
}
system("PAUSE");
}

int Fi_EXIT() {
i_EXIT++;
cout<<"Thank you for using this program!";
return i_EXIT;
}

And the output is:

Press any key to continue. . .

Help appreciated!!!

I tried an if loop too, but it didn't work either.

souldog
June 8th, 2008, 02:57 PM
change this


while (i_EXIT=0) {


which assigns 0 to I_EXIT.

to


while (0 == I_EXIT) {


which compares I_EXIT to 0

mikee32
June 8th, 2008, 05:03 PM
Thanks! :D