Strings in C
Implement a function that counts all non-printable characters in
a null-terminated string.
/**
* \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.
Strings in C Implement a function that counts all non-printable characters in a null-terminated string. /** * \brief Cou
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am