1. My fix works fine for me. Here is all of the code:
#include <iostream>
#define dc42 "Forty-Two"
int my_age = 20;
int main ()
{
const char lang[4] = "C++";
char me[6] = "Broax";
std::cout << me << " is learning " << lang << " at the age of " << my_age << "...\bWhy?...\b\t" << dc42;
return 0;
} 2. Typically, you don't use char[] arrays for strings in C++. In C, there is no string data type, only char[] arrays, so you have to use them. But C++ has the string data type, so you would normally use that. Here is the program using string:
#include <iostream>
#define dc42 "Forty-Two"
int my_age = 20;
int main ()
{
std::string lang = "C++";
std::string me = "Broax";
std::cout << me << " is learning " << lang << " at the age of " << my_age << "...\bWhy?...\b\t" << dc42;
return 0;
} Since you didn't seem to be working with strings, I suggested using a char[] array. The char data type is used for representing a single character such as 'a' or '%'. You were assigning a string of characters to a memory location which was expecting a single character. So, by changing it to a char[] array, you can store the string (or array) of characters successfully.