hi,
its been a long time since i've had to work on c and i've stumbled. I'm basically trying to get a string[5] into a 2d array stringarray[10][1]
char string[5];
char stringarray[10][1];
void workfunction();
int main(){
workfunction();
for(i=0;i<10;i++){
printf("%s", stringarray[i][0]);
}
}
workfunction(){
for(j=0;j<10;J++){
//does something to get me 2 int's x & y
sprintf(string,"%d,%d-",x,y);
string[j][0] = string; <-- HERE IS THE PROBLEM
}
}
i thought of using strcpy but that also has the reverse error (char to char pointer)
any help would be greatly appreciated thanks