Why an int*
array can't be initialized directly but char*
array can be?
I know they are not same but what's the exact difference that causes this to happen (please explain why)?
I know why it's not possible for int* p[]
to be initialized directly.
I don't know how it's possible for char* name[]
?
For example:
char* name[] = { "Mostafa Chamran", "Mehdi Zeinoddin", "Ebrahim Hemmat" };
and
int* p[3] = {1, 2, 3};
give error: invalid conversion
I didn't know what to search to find a related question so I don't know whether the same question exists or not