im making a battleship game and so far i have this but im getting an error and i don't know what it means, this is the error error C2664: 'strcpy' : cannot convert parameter 1 from 'char' to 'char *'
this is my code
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
struct coord
{
int x;
int y;
};
int main()
{
int c;
int x=0;
char view[7][25];
coord place[2];
strcpy(view[0]," ___________ ");
strcpy(view[1]," 1| o o o o o |");
strcpy(view[2]," 2| o o o o o |");
strcpy(view[3]," 3| o o o o o |");
strcpy(view[4]," 4| o o o o o |");
strcpy(view[5]," 5| o o o o o |");
strcpy(view[6]," |___________|");
strcpy(view[7]," 1 2 3 4 5 ");
cout<<view[0]<<endl;
cout<<view[1]<<endl;
cout<<view[2]<<endl;
cout<<view[3]<<endl;
cout<<view[4]<<endl;
cout<<view[5]<<endl;
cout<<view[6]<<endl;
cout<<view[7]<<endl;
cout<<""<<endl;
cout<<"Welcome to battleship"<<endl;
cout<<"First position your ships, you have 3 ships"<<endl;
cout<<"Bad idea to put all your battle ships on one coordinate"<<endl;
cout<<""<<endl;
do
{
for(int i=1;i<4;i++)
{
c=i;
cout<<"Enter the y coordinate you want to place your "<<i<<" ship(1-5)"<<endl;
cin>>place[i].y;
cout<<""<<endl;
cout<<"Enter the x coordinate you want to place your "<<i<<" ship(1-5)"<<endl;
cin>>place[i].x;
strcpy(view[place[i].y][place[i].x],"s");[B]//says that the problem is here[/B]
cout<<""<<endl;
}
system("CLS");
}
while(x>0);
cout<<view[1]<<endl;
cout<<view[2]<<endl;
cout<<view[3]<<endl;
cout<<view[4]<<endl;
cout<<view[5]<<endl;
cout<<view[6]<<endl;
cout<<view[7]<<endl;
cout<<view[8]<<endl;
return 0;
}