Im new to C++. In school we have to write a program that will prompt user input , throw it in an array. and analize the data, and if anything in the array is anything other than an int, to through an error stating that the user did not enter an integer.
WHEW! Ok, that said, Im using cin.get to read the data entered. And using If satements for the isdigit(cInput); cInput being the data entered by the user. My problem comes when the compiler sees cInput as a string entered by the user. (I declared it as char)
And it cant convert char * to int. I tried doing atoi(cInput) to convert the char string to int, but it makes no difference to the compiler. HELP !!
Post some code, yo. Lets see what you've done thus far. (and please for our viewing pleasure paste your code within a code block - begins with [code] and ends with [/code])
Helpful hint: isdigit checks 1 character at a time, not a whole string.