#include #include #include using namespace std; // this is what you would do if you know the length of values in the array void print_char_array(char ca[], int length) { // for loop! for (int i = 0; i < length; i++) { cout << ca[i]; } cout << endl; } // this is what you do when you don't void print_cstr(char ca[]) { // note it's a standard counting loop, but with // a different end condition int i = 0; while (ca[i] != '\0') { cout << ca[i]; i++; } cout << endl; // note: you could use a for loop, like: // for (int i = 0; ca[i] != '\0'; i++) } bool isPalindrome(char word[]) { // figure out the length first // then compare first to last until you reach the middle } int main() { // c-style strings (null terminated character arrays) char name[64]; // no separate int to track length name[0] = 'h'; name[1] = 'e'; name[2] = 'l'; name[3] = 'l'; name[4] = 'o'; // instead, the end is delimited by the null character (ASCII code 0) name[5] = '\0'; system("pause"); }