hi! i just started programming and am taking a class, im wondering if you could help me understand why this if statement crashes the program. i include some lines from top of program since maybe it has something to do with it.
#include <iostream>
#include <cctype>
#include <string>
using namespace std;
char* C_type = new char[100]; // create array to store types
int* KWH_used = new int[100]; // create array to store kwh used
cout << "How many kilowatt hours did this customer use? ";
cin >> KWH_used[x];
if ( isalpha(KWH_used[x]) ) //why no worky?
//if (KWH_used[x] > 5000) (im using this currently to work)
cout << "Sorry that is not valid input.(DELETING CUSTOMER TYPE)" << endl;
else
x++;