Question. How come the strings such as "C Programming" is compiled as address values as following?
#include <stdio.h>
void ShowAllString(int argc, char * argv[])
{
int i;
for(i=0; i<argc; i++)
printf("%s \n", argv[i]);
}
int main(void)
{
char * str[3]={
"C Programming",
"C++ Programming",
"JAVA Programming" };
ShowAllString(3, str);
return 0;
}
My analogy was like the following... please correct me if you can.
char * argv[] if in parameter, that is equivalent to char ** argv . So the function is like void ShowAllString(int argc, char ** argv) to receive double pointer as argument. So it makes sense to have str as parameter because str is the name of the array char * str[3] and str is double pointer here as array name. char * str[3] is an array that is supposed to have three elements of pointers.... but how come such strings instead of address values are placed next to char * str[3]... this is where I am stuck!
Please help me!