StrCat - i j s3[j = 0 int main char first ="Eric"...

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

View Full Document Right Arrow Icon
#include <iostream> #include <iomanip> using namespace std; void concat(char s1[], char s2[], char s3[], int size) { int i = 0 ; while (s1[i] != 0) { s3[i] = s1[i] ; ++ i ; } int j = i - 1 ; i = 0 ; while (s2[i] != 0) { s3[j] = s2[i] ;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ++ i ; ++ j ; } s3[j] = 0 ; } int main() { char first = "Eric" ; char last = "Van Wyk" ; char full[50] ; concat(first,last,full,50) ; cout << "My full name is: " << full << "." << endl ; }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online