Extracting letters

Does anyone know how i could go about extracting and checking if the very first character in my string array is an alphabet

PLease Help

Thnx
closed account (o3hC5Di1)
Hi there,

You probably need either isalnum() or isalpha() from the <cctype> header:
http://www.cplusplus.com/reference/cctype/

If you are using std::string you can access individual characters by using the subscript dereference operator []:

1
2
3
std::string test("foo");

std::cout << test[0]; //prints 'f' 


Hope that helps.

All the best,
NwN
Topic archived. No new replies allowed.