adding multiple char arrays into 1

so i have this program i have to write were i first have to ask for input of a string then determine how many characters its has. then i have to ask again for more input and add the two strings together and compare if it is equal to a set char array and lastly change the string reprint it and state if its the same as the the set array "ABC" now using prototypes of c functiions but cant use them such as <cstring>'s strlen(), strcmp(), and strcpy() instead have to write the whole program using array syntax! this is what i have right now but stumped on writing the function to add the arrays together please help!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
#include <iostream>
  using std::cin;
  using std::cout;
  using std::endl;

int myStrLen(const char[]); // return length of null-terminated
// string stored in char array

void myStrCpy(char[], const char[]); // copy the contents of the 
// 2nd string into the 1st

int myStrCmp(const char[], const char[]); // return 0 if two strings
// are equal, else return 1

int main()
{
 
  char text[128];
  cout << "enter text: ";
  cin.getline(text, 128);
  char abc[] = "ABC";

  cout << "String: " << text << endl;
  cout << "Length: " << myStrLen(text) << endl;

    return 0;
}

int myStrLen(const char *ptr)
{
    //variable used to access the subsequent array elements.
    int offset = 0;
    //variable that counts the number of elements in your array
    int count = 0;

    //While loop that tests whether the end of the array has been reached
    while (*(ptr + offset) != '\0')
    {
        //increment the count variable
        ++count;
        //advance to the next element of the array
        ++offset;
    }
    //return the size of the array
    return count;
}
I think the other guy that posted this, is in the same class as you:

http://www.cplusplus.com/forum/beginner/92796/
not in same class but ya i get what this guy is trying todo but I dont think it helps i need a void function using void(char[], const char[]) they are using two const chars?
Topic archived. No new replies allowed.