Please help me in understanding the below code, my expected output is "50".I'm able to get this output when I return pointer "s" from function "f" and in main I need to make this changes s= f(s,i).
void f(char *s,int i)
{
s = (char*)malloc (20 *sizeof(char));
s[i++]=50;
s[i++]=53;
return;
}
int main()
{
int i = 10;
char *s = NULL;
f(s,i);
printf(" s[%d]= %u \n",i,s[i]);
free(s);
return 0;
}