CStrings - } cout <<...

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

View Full Document Right Arrow Icon
#include <iostream> #include <iomanip> #include <cstring> using namespace std; int main() { char first[] = "Eric" ; char last[] = "Van Wyk" ; char full[50] = ""; if (strcmp(first,last)) { cout << "The strings are not the same." << endl ; } else { cout << "The strings are the same." << endl ;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } cout &lt;&lt; strcmp(first,last) &lt;&lt; endl ; strcat(full,first) ; strcat(full,&quot; &quot;); strcat(full,last) ; cout &lt;&lt; &quot;My full name is: &quot; &lt;&lt; full &lt;&lt; endl ; cout &lt;&lt; &quot;The length is &quot; &lt;&lt; strlen(full) &lt;&lt; endl ; }...
View Full Document

Ask a homework question - tutors are online