Page 1 of 1

Strings in C Implement a function that counts all non-printable characters in a null-terminated string. /** * \brief Cou

Posted: Mon Mar 21, 2022 4:41 pm
by answerhappygod
Strings in C
Implement a function that counts all non-printable characters in
a null-terminated string.
Strings In C Implement A Function That Counts All Non Printable Characters In A Null Terminated String Brief Cou 1
Strings In C Implement A Function That Counts All Non Printable Characters In A Null Terminated String Brief Cou 1 (14.01 KiB) Viewed 62 times
/**
* \brief Counts non-printable characters in a
null-terminated string.
*
* \param str A null-terminated string containing some
non-printable characters
* \return Number of non-printable characters
*
* \note stdlib provides useful character handling
functions in ctype.h.
* ctype.h documentation also states
different character classes,
* including printable characters.
*
* \note In your implementation, do not write to stdout to
check the functionality.
* You should use my_tests function to
print and check the functionality
* of your implementation.
*/
unsigned int count_non_printable(const char* str) {
int non_printable_count = 0;
//TODO: Implement your function here.
return non_printable_count;
}
Strings in C Implement a function that counts all non-printable characters in a null-terminated string. Hint stdlib provides useful character handling functions in ctype.h. ctype.h documentation also states different character classes, including printable characters.