Feb 14, 2018 #1 J JC724 Weaksauce Joined Jan 20, 2016 Messages 118 I really don't understand how isprint and iscntrl works? I was reading up online and it still didn't make a lot of sense to me? Can someone break down how both of those functions work?
I really don't understand how isprint and iscntrl works? I was reading up online and it still didn't make a lot of sense to me? Can someone break down how both of those functions work?
Feb 15, 2018 #2 modi123 Supreme [H]ardness Joined Sep 6, 2006 Messages 7,218 What's to not understand? IsPrint - takes in a character and returns 0 if not printable, and any other number if true. http://www.cplusplus.com/reference/cctype/isprint/ iscntrl is the same input/oputput but this time checks if control character. http://www.cplusplus.com/reference/cctype/iscntrl/ Remember - there are ascii characters that can be printed to the screen and others that are not. Both of those links show the hexcode it checks if the characater between, and you cna follow along with an ascii table. example: http://www.bluesock.org/~willg/dev/ascii.html
What's to not understand? IsPrint - takes in a character and returns 0 if not printable, and any other number if true. http://www.cplusplus.com/reference/cctype/isprint/ iscntrl is the same input/oputput but this time checks if control character. http://www.cplusplus.com/reference/cctype/iscntrl/ Remember - there are ascii characters that can be printed to the screen and others that are not. Both of those links show the hexcode it checks if the characater between, and you cna follow along with an ascii table. example: http://www.bluesock.org/~willg/dev/ascii.html
Feb 16, 2018 #3 ChristianVirtual [H]ard DCOTM x3 Joined Feb 23, 2013 Messages 2,561 for testing modi123 comment: try to print asc(0x7)