I have a program that contains the following piece of code for constructing an array of asterisks:
char array[Length][Height];
for (int count1 = 1; count1 <= Length; count1++)
{
for (int count2 = 1; count2 <= Height; count2++)
{
strcpy(array[count2][count3], "*");
cout << array[count2][count3];
}
}
cout << endl;
When I attempt to compile the program, I receive the following output:
waves.cpp:48: error: invalid conversion from ‘char’ to ‘char*’
waves.cpp:48: error: initializing argument 1 of ‘char* strcpy(char*, const char*)’
The 'char*' part of the output lead me to do some reading on pointers, and while I understand the basic principle of them, actually implementing them is proving somewhat difficult (and I guess that's the difference between reading about something and doing it).
If someone could tell me where I'm going wrong in this code so I could use it as a worked example, it would go a long way to helping me understand the use of pointers.