"Ross" <kk******@cuhk.edu.hk> writes:
char chain[10][300];
strcpy(chain[i+20], chain[i]);
error C2664: 'strcpy' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires
reinterpret_cast, C-style cast or function-style cast
As others have mentioned, you should invoke your compiler in C mode
rather than C++ mode, but I don't think that's your problem.
The first argument to strcpy is of type char[300], which is converted
to char*. The compiler is saying that it's of type char. The only
explanation I can think of is that the code you posted isn't the same
as the code you're trying to compile.
If you post a code sample, you need to cut-and-paste the *exact* code;
we can't guess what your actual code looks like.
--
Keith Thompson (The_Other_Keith)
ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.