Here is my code:
void doSomething(){
char arr[5][10];
arr[1] = "Bob";
arr[2] = "Steve";
arr[3] = "Tim";
arr[4] = "Ruth";
arr[5] = "Heather";
init(arr);
void init(char *array){
int i;
newArr[5][10];
for(i=0; i<5; i++){
newArr[i] = *(array + i);
}
}
I keep getting an error saying:
warning: passing argument 1 of ‘init’ from incompatible pointer type [enabled by default] note: expected ‘char ’ but argument is of type ‘char ()[10]’
arrayto be of typechar *but you are using it as if it were declared to be of typechar *[].