I had a basic clarification . Here is the code snippet I tried.
void fill(char s[])
{
strcpy(s,"temp");
}
int main()
{
char line[100];
fill(line);
printf("%s",line);
return 0;
}
As expected, the output is temp.line is a local array but it can be modified in fill and is reflected back in the caller. My understanding is ,this works because when we say fill(line) we are actually passing the address of start of an array.
Am I correct ?