// Program file: strnocmp.cpp #include #include using namespace std; int main() { char word1[11] = "computer"; char word2[11] = "computer"; string str1 = "monitor"; string str2 = "monitor"; clrscr(); cout << word1 << " " << word2 << endl; if (word1 == word2) cout << "char arrays are equal " << endl; else cout << "char arrays are not equal " << endl; if (str1 == str2) cout << "strings are equal " << endl; else cout << "strings are not equal " << endl; printf("%-20s,%10x \n", "Address of word1", &word1); printf("%-20s,%10x \n", "Address of word1[0]", &word1[0]); printf("%-20s,%10x \n\n", "Address of word1[1]", &word1[1]); printf("%-20s,%10x \n", "Address of str1", &str1); printf("%-20s,%10x \n\n", "Address of str2", &str2); strcpy(word2, "aaaaaaaaaaaaaaaaa"); strcpy(word2, word1); printf("%-20s,%10x \n", "Address of word1", &word1); printf("%-20s,%10x \n\n", "Address of word2", &word2); cout << word1 << " " << word2 << endl; getch(); return 0; }