I want to check if my array has only numbers how can I check it out?
i try this example but this not working and i dont Understand why.
int main() {
char* str = new char[9];
cin >> str;
cout << isdigit(str[0])<<endl;
system("pause");
return 0;
}
input:
1234
output: 4
what i want is:
input: 1234
print: ok
input:
12fg
print: not ok (because the character in my array)
I look forward to your help and explanation
thank's.