Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- using namespace std;
- void strconcatenate(string s1[],string s2[],string s3[],int size) {
- int reached = 0;
- for (int i = 0; i < size; i++) {
- s3[i] = s1[i];
- reached++;
- }
- s3[reached] = "**";
- reached++;
- for (int i = 0; i < size; i++) {
- s3[reached] = s2[i];
- reached++;
- }
- }
- void main() {
- string s1[20];
- string s2[20];
- string s3[41];
- for (int i = 0; i < 20; i++) {
- cout << "Please Input first string array index " << i << endl;
- cin >> s1[i];
- }
- for (int i = 0; i < 20; i++) {
- cout << "Please Input second string array index " << i << endl;
- cin >> s2[i];
- }
- strconcatenate(s1, s2, s3,20);
- for (int i = 0; i < 40; i++) {
- cout << s3[i] << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement