Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
how i can write a function that return true only if the charactar is lowercase charactar
,i can't use if statement

What I have tried:

C
bool lowecase(char c)
if(c>='a'&&c<='z')
   return true;
else
   return false;
Posted
Updated 29-Apr-16 4:07am
v2

1 solution

How about using the islower()[^] method.
 
Share this answer
 
Comments
[no name] 28-Apr-16 18:23pm    
i don't know this method
[no name] 28-Apr-16 18:25pm    
if i write..
bool isLower(char c) {
return (c >= 'a') && (c <= 'z');
}
is this true at all ?
nv3 28-Apr-16 18:40pm    
As this is obviously homework I will not provide you the answer. Just a hint:

(c >= 'a') && (c <= 'z')

is an expression. Now, what data type has this expression? And then you know, which values it might assume. If you return this value, does it do what you want?

If you answer those questions you will find your solution.
[no name] 28-Apr-16 18:53pm    
mmm so is it enough to type:
return (c >= 'a') && (c <= 'z');
[no name] 28-Apr-16 18:54pm    
i don't think i fully understood what you wrote :/

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900