what's the difference between:

char *p[]={
"ron","is best",
"harry","is good"'
};

and

char *p[][40]={
"ron","is best",
"harry","is good"'
};

as both are working quite similar for a particular program

The first one is a pointer to a string. The second one is a pointer to an array of strings. You are not noticing the difference as both of them can be initialised in a similiar way. You will notice it once you try to modify these pointers.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.