The expression
myArray[i] != '\0'
is equivalent to
myArray[i] != NULL
But your array does not contain an element with the value NULL.
So either declare the array like
char *myArray[]={"Carmaker1","Carmaker2","Carmaker3","Carmaker4","Carmaker5","Carmaker6", NULL};
(appending an initializer with the value NULL
) and use the loop
for ( int i = 0 ; myArray[i] != NULL ; i++ ) {
printf("%s ",*(myArray+i));
}
Or you can append the array with an empty string like
char *myArray[]={"Carmaker1","Carmaker2","Carmaker3","Carmaker4","Carmaker5","Carmaker6", ""};
and write the loop like
for ( int i = 0 ; myArray[i][0] != '\0' ; i++ ) {
printf("%s ",*(myArray+i));
}
Or using the current declaration of the array change the loop the following way
for ( size_t i = 0 ; i!= sizeof( myArray ) / sizeof( *myArray ) ; i++ ) {
printf("%s ",*(myArray+i));
}