CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2008
    Posts
    2

    While loop does not run!

    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.

  2. #2
    Join Date
    Nov 2002
    Location
    Los Angeles, California
    Posts
    3,863

    Re: While loop does not run!

    change this

    Code:
    while (i_EXIT=0) {
    which assigns 0 to I_EXIT.

    to

    Code:
    while (0 == I_EXIT) {
    which compares I_EXIT to 0
    Wakeup in the morning and kick the day in the teeth!! Or something like that.

    "i don't want to write leak free code or most efficient code, like others traditional (so called expert) coders do."

  3. #3
    Join Date
    Jun 2008
    Posts
    2

    Talking Re: While loop does not run!

    Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured