question4 - str1++ // Advance to the next character str2++...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream> using namespace std bool match(const char str1[ ], const char str2[ ]) { { if (*str1 == *str2) {// Compare corresponding character
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: str1++ // Advance to the next character str2++ return true } else { return false } } } int main() { char a[ ] = "pointed" char b[ ] = "pointed" if (match(a,b)) cout << "They're the same!\n" }...
View Full Document

This note was uploaded on 04/12/2009 for the course CS 31 taught by Professor Melkanoff during the Winter '00 term at UCLA.

Ask a homework question - tutors are online