Talk:C character classification
![]() | This article is rated Start-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||
|
{{Talk header]]
Untitled
editI don't think C source code listing is appropriate for any encyclopedia article. Why not cut out the "Implementation" section, and rather include an external link to a website with the code? Chitu 19:12, 13 May 2004 (UTC)
- I disagree. This entire article (including the source code) might be lost on someone with no computer science experience, but for someone who has done some programming but is not familiar with the particular problem ctype.h is designed to fix, seeing some example source can make a huge difference in readability. Count me in this group; I think it should stay. CyborgTosser 01:59, 31 Aug 2004 (UTC)
SCO v. IBM
editErm... There is no such thing as a "Linus Torvalds's kernel mailing list post below" in the article... Medinoc 09:24, 16 May 2007 (UTC)
Cast arguments
edit>> The correct way to use char arguments is to first cast them to unsigned char.
This is incorrect. If the argument is representable in an unsigned char, then it is a non-negative number, this is what "representable in an unsigned char" means, so conversion to int type will not make it negative or change the bit pattern in any way. —Preceding unsigned comment added by Velco (talk • contribs) 18:20, 2 November 2008 (UTC)
- I agree that *after* one casts a char to an unsigned char, then it is a non-negative number "representable in an unsigned char", and further conversion to int type will not make it negative.
- I don't see how that makes "first cast char arguments to unsigned char" incorrect. For example:
#include <stdio.h>
#include <ctype.h>
int main(void) {
signed char c;
printf("%s", "Type a letter.\n");
c = getchar();
if( isupper( (unsigned char) c ) ){
printf("%s", "Uppercase! YAY!\n");
}else{
printf("%s", "not uppercase.\n");
};
return 0;
}
seems correct to me. Or is there something that needs to be fixed? Leaving out that (unsigned char) cast
...
if( isupper( c ) ){ // incorrect
...
seems incorrect to me, as it could potentially pass a negative integer to isupper(). --68.0.124.33 (talk) 20:23, 6 March 2009 (UTC)
Casting to unsigned char means you don't correctly consider EOF. I believe the safest method is to first check for EOF, and then cast to unsigned char. I'll update this on the page as well. Kasterma (talk) 13:22, 6 July 2011 (UTC)
Move discussion in progress
editThere is a move discussion in progress which affects this page. Please participate at Talk:C standard library - Requested move and not in this talk page section. Thank you. —RM bot 09:40, 8 November 2011 (UTC)
International character support
editIt is not clear if this library intend to addressee i18n (internationalisation) issues such as ISO-2022 or its Unicode concurrent. Which one does C support best?
It is not clear how C character classification should be considered in regard to the single byte character vs multiple byte vs wide character context.
Also: Is there any classification for the Byte Order Mark? — Preceding unsigned comment added by 84.97.14.22 (talk) 20:01, 22 July 2012 (UTC)
India Education Program course assignment
editThis article was the subject of an educational assignment supported by Wikipedia Ambassadors through the India Education Program.
The above message was substituted from {{IEP assignment}}
by PrimeBOT (talk) on 19:56, 1 February 2023 (UTC)