I am currently using the Visual C++ compiler on a WIN 2000 system. I am trying to scan in user input and then assigning what was entered into one of the dimensioanl arrays.
In the Visual C++ compiler, it gave me this error:
error C2664: 'strcpy' : cannot convert parameter 2 from 'char [3][20]' to 'const char *'
So, I tried to copy and paste the same exact code into Miracle C (another C compiler) and it worked.
Is this a Visual Studio bug? How can I work around it? HELP PLEASE!!!
Code:#include <stdio.h> #include <string.h> char charname[3][20]; int i; int main() { for (i=0; i<3; i++) { printf("Enter in something: "); scanf("%s", charname); strcpy(charname[i],charname); printf("%s\n",charname[i]); } return(0); }