class foo
{
foo();
private:
char table[64];
};
foo::foo()
{
for(int index=0; index < 64; index++)
General coding practice advice 1: try to get into the habit of
writing '++index' instead of 'index++'.
General coding practice advice 2: don't litter your code with
magic numbers like '64'; give them names.
table[index] = index;
}
in the main program I do ;
foo test;
That should not compile since you don't have an accessible default
constructor (members of a 'class' are private by default, and you
use the default in the declaration of the default constructor).
nothing more, just run the constructor
it seems to run through the above loop coz I get 'Press any key to continue'
then I get popup box saying test.exe has encountered a problem and needs to
close. We are sorry for the inconvenience.
It seems you're victim of a less than correct compiler.
Make the default constructor public and try again.