K
kk
I wanna initialize a 3D character string array with a string "abc" but the
above VC 6.0++ compiler failed to do so.
what's the problem of the below codes and how to modify it?
char interface_aanum[10][100][4];
for (int k=0; k<10; k++)
for (int i=0; i<100; i++)
strcpy(interface_aanum[k], "abc");
error C2107: illegal index, indirection not allowed
error C2664: 'strcpy' : cannot convert parameter 1 from 'char (*)[4]' to
'char *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
above VC 6.0++ compiler failed to do so.
what's the problem of the below codes and how to modify it?
char interface_aanum[10][100][4];
for (int k=0; k<10; k++)
for (int i=0; i<100; i++)
strcpy(interface_aanum[k], "abc");
error C2107: illegal index, indirection not allowed
error C2664: 'strcpy' : cannot convert parameter 1 from 'char (*)[4]' to
'char *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast