Excersice 4 says Write a program that contains four arrays. Three of the arrays should contain your
first name, middle initial, and last name. Use the string-copying function presented
in today’s lesson to copy these strings together into the fourth array, full name.
and this what i came up with
#include <iostream>
#include <string>
using namespace std;
using std::cout;
using std::endl;
--------------------Configuration: testtt - Win32 Debug--------------------
Compiling...
testtt.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\testing\testtt.cpp(18) : error C2110: cannot add two pointers
C:\Program Files\Microsoft Visual Studio\MyProjects\testing\testtt.cpp(21) : error C2440: '=' : cannot convert from 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' to 'char [1]'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.
Are you sure your teacher didn't mean strcat(), or strcpy()?
Anyway, the problem is that you can't add C strings. You need to first set the std::string to the first C string, and only then can you append the other strings with the += operator, but only one at a time.