The size of the array has to be known at compile time. If it has to be decided at run-time please use dynamic arrays. When you used #Define the size was known at compile time hence it worked.
Agni
Practically a Master Poster
655 posts since Dec 2007
Reputation Points: 431
Solved Threads: 116
That's because you're mixing cin << with cin.get();
cin << ... leaves a "\n" (end of line) character on the stream and when you then call cin.get(), that character is still on the stream, so you aren't able to type anything. (cin.get only takes 1 char)
To avoid this problem, use:
#include <limits.h>
[...code...]
cin.ignore ( INT_MAX, '\n' );
cin.get();
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403