+ 1

How to use <ctype.h> headerfile?

It shows \302 error.

10th Jun 2020, 3:20 PM
Mohan S
Mohan S - avatar
5 Answers
+ 1
Use <cctype> for a c++ program not <ctype.h>. I usually get the "\302" error when I copy and paste into "code playground" (probably pasting some "invisible" characters), so just back-space each line to left-had-side of the code pane then re-indent/re-align. edit; http://www.cplusplus.com/reference/cctype/
10th Jun 2020, 5:07 PM
rodwynnejones
rodwynnejones - avatar
+ 1
https://www.google.com/amp/s/www.geeksforgeeks.org/ctype-hcctype-library-in-c-c-with-examples/amp/ https://www.tutorialspoint.com/c_standard_library/ctype_h.htm#:~:text=The%20ctype.,representable%20as%20an%20unsigned%20char. Check these ☝☝☝
10th Jun 2020, 5:08 PM
ê§àŒ’â˜ŹBad☏Boyâ˜ŹàŒ’ê§‚
ê§àŒ’â˜ŹBad☏Boyâ˜ŹàŒ’ê§‚ - avatar
+ 1
I tried to include ctype.h and print hello world in sololearn and it compiled successfully 🙂, When I tried to include ctype it gave an error )
10th Jun 2020, 5:11 PM
ê§àŒ’â˜ŹBad☏Boyâ˜ŹàŒ’ê§‚
ê§àŒ’â˜ŹBad☏Boyâ˜ŹàŒ’ê§‚ - avatar
+ 1
Rodwynnejones, I corrected my code but it shows error.please correct it and retype this code. https://code.sololearn.com/cR7Qx4ah4pcV/?ref=app in my pc it works.But it not works in sl
10th Jun 2020, 5:21 PM
Mohan S
Mohan S - avatar
0
@ê§àŒ’â˜ŹBad☏Boyâ˜ŹàŒ’ê§‚ It's <cctype> not <ctype) ...although it's not actually used in the code posted. @Mohan 333.... Separate your input from your "sort" routine i.e:- for(i=0; i<5; i++) { cout<<" "; cin>>str[i]; } for(i=0; i<5; i++) for(j=1; j<5; j++) { if(strcmp(str[j-1],str[j])>0) { strcpy(t,str[j-1]); strcpy(str[j-1],str[j]); strcpy(str[j], t); } }
10th Jun 2020, 8:40 PM
rodwynnejones
rodwynnejones - avatar