Just trying to do something very basic (and slightly pointless) with an array of strings...just to help with the learning process. Why won't the following work?
I've tried that but it just outputs nonsense in the console window. Also, does that mean you have to use character arrays if you want to use the string functions?
Also, does that mean you have to use character arrays if you want to use the string functions?
In C++, this is a string: string someString;
This is a pointer to the first element in an array of char: char* somePointer = "EggsOnToast";
strcpy does not operate on strings. You can check that by looking it up. It operates on char pointers. If you have a function that operates on char pointers, you must feed it char pointers. If you have a function that operates on strings, you must feed it strings.
In C, people often used the word "string" to refer to an array of char. Now that we have proper C++ string objects, you should take care not to get the two mixed up. This is what you did in your code above; you tried to feed a string to something that expected a char pointer.