Perhaps you need to supply a value to m before you try to use it?
But since it seems that this may be used to "size" an array you should probably use a constant value instead constint MAXNUM = 100; as array sizes must be compile time constants in C++.
If the user tries to enter something other than a digit, plus, or minus as the first character into a int variable, or any other numeric type, the stream will be put into an error state. You can test the stream state to determine it's state and if it is in a fail state you can clear the error state then clear the input buffer, and then ask the user to re-enter a correct value or whatever you deem appropriate.
1 2 3 4 5 6 7 8 9 10 11 12
int number;
cout << "Please enter a number: ";
cin >> number;
// Check for an error in the stream.
while(!cin)
{
cout << "Error you didn't enter a number!\nPlease retry: ";
cin.clear(); // Clear the error flags.
cin.ignore(2000, '\n'); // Clear the input buffer.
}