Website Design United States, Website Design California, Website Designing United States, Website Designing California

Using #define to find if a character is alphabetic - C++

This is a simple example to demonstrate a #define. These #defines will return a true/false based on if the character passed in is upper case, lower case or alphabetic (no numbers or special characters).

You use the define just like a function.

#define IS_LOWER_CASE(x) ( ( (x) >= 'a' ) && ( (x) <= 'z' ) )

#define IS_UPPER_CASE(x) ( ( (x) >= 'A' ) && ( (x) <= 'Z' ) )

#define IS_ALPHABETIC(x) ( IS_LOWER_CASE(x) || IS_UPPER_CASE(x) )

WEB DESIGN INDIA
42 B Malviya Nagar , New Delhi-110017

Skype: manmeetsi
Email: support.webdesignindia@gmail.com
Tel: 91-011-40502005, 9810067295

 















 


© 2008-2009 dotnet4all.com