Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Filter out any non-printable characters

int ch, N = 0;
while ((ch = getchar()) != EOF) {
    if (isspace(ch))
        a[N++] = ' ';
    else if (isprint(ch))
        a[N++] = ch;
}
Source by www.cs.princeton.edu #
 
PREVIOUS NEXT
Tagged: #Filter #characters
ADD COMMENT
Topic
Name
9+5 =