#include #include using namespace std ; int main() { //The below syntax automatically assigns the null character //at the end. char name1[] = "Jerry Quarry" ; //With the below style we need to manuall assign the //null character at the end char name2[] = { 'C' , 'a' , 'r' , 'l' , '\0' } ; //Safe since we have enough space in the array name3 char name3[9] = "Thompson" ; printf( "%s\n" , name1 ) ; printf( "%s\n" , name2 ) ; printf( "%s\n" , name3 ) ; cout << name1 << " " << strlen( name1 ) << " length of array:" << sizeof(name1) << endl ; cout << name2 << " " << strlen( name2 ) << endl ; cout << name3 << " " << strlen( name3 ) << endl ; char name4[80]; strcpy (name4,"Ike "); strcat (name4,"Ibeaubuchi"); cout << name3 << " Length of name4 is: " << strlen(name4) << endl ; char name5[] = "Archie Moore continued boxing in his 40s."; char delimiters[] = " "; // Space is the delimiter char *token; // Get the first token token = strtok(name5, delimiters); // Loop through all tokens while (token != NULL) { printf("Token: %s\n", token); token = strtok(NULL, delimiters); // Use NULL for subsequent calls } return 0 ; }