In C++ you can't assign a string to an array by doing the following (or anything like it);
text[40]="i want it like that";
Why is this disallowed? Because "text[40]" is actually the 41st element of the array "text[]". And having used "char text[40];" to define the array in the first place, then the last element of the array is "text[39]" (remember the FIRST element is text[0]). It turns out that the command; 'text[40] = "i want it like that";' is really an attempt to stuff a string of 20 (or thereabouts) char into a single char block of memory which actually resides _outside_ the memory allocated for the defined array.
So you can see why it doesn't work!
What C++ does allow you to do is to assign the contents of the array at the same time you define the array. You can do this in two ways;
The first gives you an array of 40 char containing the string "i want it like that";
char text[40] = "i want it like that";
The second lets the compiler determine the array size, giving you an array exactly large enough to contain the specified string;
char text[] = "i want it like that";
If you want to do more than this -- particularly if you want to change the contents of the array while the program is running -- you will need to use string functions - or something like getline() at the very least.