problem with array position copying...
Posted: Wed Apr 18, 2007 7:37 pm
this is the part of the code where I get the error,
I have all the ints and chars set up.
the problem is with the strcpy(smpl2[i], "*");
when I remove the [i] it will accept it,
but it will not do the function right because it just copying 1 char,
when I do the array it is supposed to use the array position which is i.
what do I need to do?
I have all the ints and chars set up.
- Code: Select all
for(i = 0, l = strlen(smpl)-1; i < l; i++, l--) {
strcpy(smpl2[i], "*");
}
the problem is with the strcpy(smpl2[i], "*");
when I remove the [i] it will accept it,
but it will not do the function right because it just copying 1 char,
when I do the array it is supposed to use the array position which is i.
what do I need to do?