C++ examples for Data Type:char array
Using memchr to search for a byte
#include <iostream> #include <cstring> // memchr prototype using namespace std; int main() /* w ww. j a v a 2s.c o m*/ { char s[] = "This is a string"; cout << "s = " << s << "\n" << endl; cout << "The remainder of s after character 'r' is found is \"" << static_cast< char * >( memchr( s, 'r', 16 ) ) << '\"' << endl; }