I am trying to copy the value of argv[i]
(which is a string) into a char array x[10]
by using strcpy()
.
Code:
char x[10];
int main(int argc, char *argv[])
{
for (int i = 1; i < argc; i++)
{
strcpy(x[i],argv[i]);
}
.....
}
output
expected 'char * restrict' but argument is of type 'char'
61 | char * __cdecl strcpy(char * __restrict__ _Dest,const char * __restrict__ _Source);