Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm a little confused between a unichar and a char. Can I treat unichar's similar to char's?

For example, can I do this:

-(BOOL)isNewLine:(unichar)c {

if(c == '
')
  return YES;
else
  return NO;

}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
723 views
Welcome To Ask or Share your Answers For Others

1 Answer

Yes, unichar is internally unsigned short, so you can meaningfully compare it with a char (if the latter is ASCII, but that works fine for ' ').


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...