Hi all:

Here are two C++ programs. 

The first one doesn't work, while the second one does. 

// --------------------------------

#include <iostream>

int i;
i = 5;

int main(int argc, char *argv[])
{
    return 0;
}

// --------------------------------

On attempting to compile the program above, the following error
is seen,
error: expected constructor, destructor, or type conversion
before '=' token


// --------------------------------

#include <iostream>

int main(int argc, char *argv[])
{
    int i;
    i = 5;

    return 0;
}

// --------------------------------


Any suggestion as to why it is so ?


thanks
Saifi.

Reply via email to