question4secondplan - str1++ // Advance to the next...

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 characters return false
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 *str1 == *str2 // Both ended at same time } 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